Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by smfmetro10
at 2024-08-07 15:28:13
Point:500 Replies:13 POST_ID:828711USER_ID:11607
Topic:
JavaScript;Scripting Languages;Asynchronous Javascript and XML (AJAX)
Hi,
I have a webpage where I am pulling youtube videos automatically from a youtube channel.
I would like to be able to add a search feature to the webpage.
So far I can only search the entire youtube instead of a specific channel.
Is it possible? I would only like to be able to search this channel : http://www.youtube.com/user/doctorscompany/
Here is the code I have so far:
<script src="https://www.google.com/jsapi"
type="text/javascript"></script>
<script type="text/javascript">
google.load("search", "1");
// Call this function when the page has been loaded
function initialize() {
var searchControl = new google.search.SearchControl();
searchControl.addSearcher(new google.search.VideoSearch("doctorscompany"));
searchControl.draw(document.getElementById("searchcontrol"));
}
google.setOnLoadCallback(initialize);
</script>
I have a webpage where I am pulling youtube videos automatically from a youtube channel.
I would like to be able to add a search feature to the webpage.
So far I can only search the entire youtube instead of a specific channel.
Is it possible? I would only like to be able to search this channel : http://www.youtube.com/user/doctorscompany/
Here is the code I have so far:
<script src="https://www.google.com/jsapi"
type="text/javascript"></script>
<script type="text/javascript">
google.load("search", "1");
// Call this function when the page has been loaded
function initialize() {
var searchControl = new google.search.SearchControl();
searchControl.addSearcher(new google.search.VideoSearch("doctorscompany"));
searchControl.draw(document.getElementById("searchcontrol"));
}
google.setOnLoadCallback(initialize);
</script>
Expert: duncanb7 replied at 2024-08-08 11:27:35
Thanks, and sorry misunderstood what you say
you can open new thread, It might NOT be too hard
you can open new thread, It might NOT be too hard
Expert: duncanb7 replied at 2024-08-08 11:22:29
you can use javascript code to do that
when your users input "six Steps", you can convert
it to "ytchannel:doctorscompany Six Steps"
before submitting google function or press button
That is all
Duncan
when your users input "six Steps", you can convert
it to "ytchannel:doctorscompany Six Steps"
before submitting google function or press button
That is all
Duncan
Author: smfmetro10 replied at 2024-08-08 11:21:10
Thanks!
Author: smfmetro10 replied at 2024-08-08 11:20:44
You're right. I will close this question and start another one
Thanks for the help!
Thanks for the help!
Author: smfmetro10 replied at 2024-08-08 11:18:59
I'm working on a website that pulls in the videos from the youtube channel automatically.
So if a user types in only "six steps" it will pull in videos from all youtube channels.
I need a way to tell the search to only search from a specific channel without having to type the channel in the search box.
i.e. searchControl.execute("ytchannel:doctorscompany Six Steps");
So if a user types in only "six steps" it will pull in videos from all youtube channels.
I need a way to tell the search to only search from a specific channel without having to type the channel in the search box.
i.e. searchControl.execute("ytchannel:doctorscompany Six Steps");
Expert: duncanb7 replied at 2024-08-08 11:14:52
I might understand you question but it is not on your topic?
Expert: duncanb7 replied at 2024-08-08 11:09:28
So what is different ?
as you said Car/Six steps in the channel of doctorscompany
why your users will type "ytchannel:doctorscompany Six Steps" ?
It is your script ? Why it is related to users ?
Please advise
Duncan
as you said Car/Six steps in the channel of doctorscompany
why your users will type "ytchannel:doctorscompany Six Steps" ?
It is your script ? Why it is related to users ?
Please advise
Duncan
Author: smfmetro10 replied at 2024-08-08 11:01:46
Thanks for the Help!
My problem is that I don't want to have to have the user type"ytchannel:doctorscompany Six Steps" in order to search for "six steps" in the channel.
Is there some sort of site restriction that would lock the search down to a specific channel without having to type the name of the channel in the search bar?
Thanks!
My problem is that I don't want to have to have the user type"ytchannel:doctorscompany Six Steps" in order to search for "six steps" in the channel.
Is there some sort of site restriction that would lock the search down to a specific channel without having to type the name of the channel in the search bar?
Thanks!
Accepted Solution
Expert: duncanb7 replied at 2024-08-08 10:27:04
500 points EXCELLENT
It is final & done, and it works at my side
<html><head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>YouTube Player API Sample</title><style type="text/css"></style><script src="http://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript"> // How to search through a YouTube channel "Six steps" at// http://www.youtube.com/user/doctorscompany google.load('search', '1'); function OnLoad() { // create a search control var searchControl = new google.search.SearchControl(); // So the results are expanded by default options = new google.search.SearcherOptions(); options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN); // Create a video searcher and add it to the control searchControl.addSearcher(new google.search.VideoSearch(), options); // Draw the control onto the page searchControl.draw(document.getElementById("content")); // Search for a YouTube channel searchControl.execute("ytchannel:doctorscompany Six Steps"); } google.setOnLoadCallback(OnLoad); </script> </head> <body> <div id="content"></div> </body></html> 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:31:32:33:34:35:36:37:38:39:40:41:42:
Expert: duncanb7 replied at 2024-08-08 10:25:35
Sorry it should be
search "Six steps" in youtube channel at http://www.youtube.com/user/doctorscompany/
since there is no "car" query in your channel
searchControl.execute("ytchannel:doctorscompany Six Steps");
Is that what you want ?
Duncan
search "Six steps" in youtube channel at http://www.youtube.com/user/doctorscompany/
since there is no "car" query in your channel
searchControl.execute("ytchannel:doctorscompany Six Steps");
Is that what you want ?
Duncan
Expert: duncanb7 replied at 2024-08-08 10:06:12
I found this useful link
https://developers.google.com/video-search/v1/devguide#load_the_javascript_api_and_ajax_search_module
could you try this following example for
searching "Car" in youtube channel at http://www.youtube.com/user/doctorscompany/
("ytchannel:doctorscompany car")
Please try it , it should work
https://developers.google.com/video-search/v1/devguide#load_the_javascript_api_and_ajax_search_module
could you try this following example for
searching "Car" in youtube channel at http://www.youtube.com/user/doctorscompany/
("ytchannel:doctorscompany car")
Please try it , it should work
<script src="http://www.google.com/jsapi?key=AIzaSyA5m1Nc8ws2BbmPRwKu5gFradvD_hgq6G0" type="text/javascript"></script> <script type="text/javascript"> // How to search through a YouTube channel aka http://www.youtube.com/members google.load('search', '1'); function OnLoad() { // create a search control var searchControl = new google.search.SearchControl(); // So the results are expanded by default options = new google.search.SearcherOptions(); options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN); // Create a video searcher and add it to the control searchControl.addSearcher(new google.search.VideoSearch(), options); // Draw the control onto the page searchControl.draw(document.getElementById("content")); // Search for a YouTube channel searchControl.execute("ytchannel:doctorscompany car"); } google.setOnLoadCallback(OnLoad); </script> 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:
Author: smfmetro10 replied at 2024-08-08 09:06:25
Thank you for the reply.
The first link is pretty close. What I'm looking for is the ability to search "within" a youtube channel. (not search for a channel)
For example I would like to be able to search for "cars" within my own channel.
Is that possible?
Thanks so much for the help!
The first link is pretty close. What I'm looking for is the ability to search "within" a youtube channel. (not search for a channel)
For example I would like to be able to search for "cars" within my own channel.
Is that possible?
Thanks so much for the help!
Expert: duncanb7 replied at 2024-08-08 08:12:25
This link is similar to your need
http://www.scis.ulster.ac.uk/~kevin/com588/labs/GC-VideoSearchCode1.txt
The assist links inside the link could help also if first one is not helping
http://stackoverflow.com/questions/6148150/youtube-video-not-loading-by-id
Duncan
http://www.scis.ulster.ac.uk/~kevin/com588/labs/GC-VideoSearchCode1.txt
The assist links inside the link could help also if first one is not helping
http://stackoverflow.com/questions/6148150/youtube-video-not-loading-by-id
Duncan