Ask Question Forum:
Model Library:2025-02-08 Updated:A.I. model is online for auto reply question page
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-08 11:50:00
Point:500 Replies:6 POST_ID:828716USER_ID:11607
Topic:
JavaScript;;Asynchronous Javascript and XML (AJAX)
Hi,
I have a website that pulls in youtube videos from a specific channel.
I would like to have a search feature that will search only that channel on the webpage.
Currently, if you type something in the search it will search all of youtube.
Is if possible to have a site restriction on the search so it will only search one channel?
You can see a working copy at: http://thelocalized.com/searchvideo/
and I have uploaded the code for better clarification.
Thanks!
I have a website that pulls in youtube videos from a specific channel.
I would like to have a search feature that will search only that channel on the webpage.
Currently, if you type something in the search it will search all of youtube.
Is if possible to have a site restriction on the search so it will only search one channel?
You can see a working copy at: http://thelocalized.com/searchvideo/
and I have uploaded the code for better clarification.
Thanks!
Attachment:index.html
Expert: duncanb7 replied at 2024-08-08 15:26:13
I need go to work after two hours after sleep
Talk you later
Anyway thanks
Duncan
Talk you later
Anyway thanks
Duncan
Author: smfmetro10 replied at 2024-08-08 15:22:49
Thanks!
Accepted Solution
Expert: duncanb7 replied at 2024-08-08 14:49:06
500 points EXCELLENT
It is done and final, and I think there is no more since inheritant google auto javascript code is controlling all addlistener events that is not easy to replace them, so I just
do some tricky to hidden "ytchannel: doctorscompany"
by changing from
searchControl.execute(" ytchannel:doctorscompany ");
to
searchControl.execute(" ytchannel:doctorscompany ");
You can see there is a lot space for hidden tricky
every input from user, just need to type "Six Steps" or any input and it will also
include "ytchannel:doctorscompany"
Now it seems works for final, hope you think that is okay, otherwise, please let
other experts to help on it .
Put more spaces in the code if you need for good outlook of inputbox without
seeing "ytchannel:doctorscompany" by users
do some tricky to hidden "ytchannel: doctorscompany"
by changing from
searchControl.execute(" ytchannel:doctorscompany ");
to
searchControl.execute(" ytchannel:doctorscompany ");
You can see there is a lot space for hidden tricky
every input from user, just need to type "Six Steps" or any input and it will also
include "ytchannel:doctorscompany"
Now it seems works for final, hope you think that is okay, otherwise, please let
other experts to help on it .
Put more spaces in the code if you need for good outlook of inputbox without
seeing "ytchannel:doctorscompany" by users
<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 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 "); } google.setOnLoadCallback(OnLoad); </script> </head> <body> <div id="content"></div> </body> 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:
Expert: duncanb7 replied at 2024-08-08 12:51:32
the url is at script js in link tag you can check from FF/chrome debugg tools
Now I try to hidden the "ytchannel:doctorscompany" in the input tag by padding-right
so user don't see the word even they typing "Six Steps"
Just finding out
Duncan
Now I try to hidden the "ytchannel:doctorscompany" in the input tag by padding-right
so user don't see the word even they typing "Six Steps"
Just finding out
Duncan
Author: smfmetro10 replied at 2024-08-08 12:37:40
I don't exactly know what any of that means: " replace the button search for channel search" ?
"replace the bold area below with users input"?
I can't find any url in the code.
I'm sorry, I just don't know what that means.
"replace the bold area below with users input"?
I can't find any url in the code.
I'm sorry, I just don't know what that means.
Expert: duncanb7 replied at 2024-08-08 11:55:28
yes, just replace the button search for channel search by your own code
and then replace the bold area below with users input
http://www.google.com/uds/GvideoSearch?callback=google.search.VideoSearch.RawCompletion&rsz=small&hl=zh_TW&source=gsc&gss=.com&sig=cf717ce13f86fb2ebeed8f0046aba6ef&q=ytchannel%3Adoctorscompany%20Six%20Steps&oq=ytchannel%3Adoctorscompany%20Six%20Steps&gs_l=partner.12...17808.19897.0.23093.0.0.0.0.0.0.0.0..0.0.gsnos%2Cn%3D13..0.0.14060j88944044j5j1..1ac.1.&qid=1405f44a11883480c&context=1&key=notsupplied&v=1.0&nocache=1375987844749e
The code will be doing for replacing "six steps" by "ytchannel:doctorscompany Six Steps"
and redirect to the google link above with correct user input
Duncan
and then replace the bold area below with users input
http://www.google.com/uds/GvideoSearch?callback=google.search.VideoSearch.RawCompletion&rsz=small&hl=zh_TW&source=gsc&gss=.com&sig=cf717ce13f86fb2ebeed8f0046aba6ef&q=ytchannel%3Adoctorscompany%20Six%20Steps&oq=ytchannel%3Adoctorscompany%20Six%20Steps&gs_l=partner.12...17808.19897.0.23093.0.0.0.0.0.0.0.0..0.0.gsnos%2Cn%3D13..0.0.14060j88944044j5j1..1ac.1.&qid=1405f44a11883480c&context=1&key=notsupplied&v=1.0&nocache=1375987844749e
The code will be doing for replacing "six steps" by "ytchannel:doctorscompany Six Steps"
and redirect to the google link above with correct user input
Duncan