youtube search page

in Ideas and script requests
Subscribe to youtube search page 6 posts, 2 voices



Luca User
FirefoxWindows

I would like to set up search page of youtbe like this:

Date added : today
&
most recent

:)

thank you very much

I

 
sdfghjklkjhg... Scriptwright
FirefoxWindows

When some one does it this will help them
url structure:
http://www.youtube.com/results?
uploaded=
m || d || w || null
&
search_type=
videos || search_playlists || search_users || null
&
search_query=
prompt('search for?')
&
search_sort=
video_avg_rating || video_date_uploaded || video_view_count || null
&
closed_captions
1 || null
&
high_definition
1 || null
&
annotations
1 || null
&
partner
1 || null

 
sdfghjklkjhg... Scriptwright
FirefoxWindows

// ==UserScript==
// @name           YouTube Advanced Search
// @description    Adds an advanced search to youtube with a crappy UI
// @include        http://www.youtube.com/*
// ==/UserScript==
function search(){
	var opt0=document.getElementById('masthead-search-term').value

	var opt1=prompt('uploaded \nm=month,d=day,w=week,or click \'OK\'');
	if (!opt1){opt1=''}

	var opt2=prompt('search_type \nvideos,search_playlists,search_users,or click \'OK\'');
	if (!opt2){opt2=''}

	var opt3=prompt('search_sort \nvideo_avg_rating,video_date_uploaded,video_view_count,or click \'OK\'');
	if (!opt3){opt3=''}

	var opt4=confirm('closed_captions \nClick \'OK\' if yes/on');
	if (opt4===true){opt4='1'}else{opt4=''}

	var opt5=confirm('high_definition \nClick \'OK\' if yes/on');
	if (opt5===true){opt5='1'}else{opt5=''}

	var opt6=confirm('annotations \nClick \'OK\' if yes/on');
	if (opt6===true){opt6='1'}else{opt6=''}

	var opt7=confirm('partner \nClick \'OK\' if yes/on');
	if (opt7===true){opt7='1'}else{opt7=''}

	document.location.href='/results?search_query='+opt0+'&uploaded='+opt1+'&search_type='+opt2+'&search_sort='+opt3+'&closed_caption='+opt4+'&high_definition='+opt5+'&annotations='+opt6+'&partner='+opt7;
}
var ele=document.getElementById('masthead-search');
if(ele){
	var t=document.createTextNode(' ');
	ele.childNodes[1].appendChild(t);
	var a=document.createElement('a');
	a.setAttribute('onclick','return false');
	a.href='#';
	a.id="GM_search"
	a.className='yt-button yt-button-primary';
	a.innerHTML='<span>Advanced</span>';
	ele.childNodes[1].appendChild(a);
	document.getElementById('GM_search').addEventListener('click',search,false);
}

if someone feels like making it fancy try using this as the foundation
http://userscripts.org/scripts/show/57622

 
Luca User
FirefoxWindows

should I copy & past in a new script in grease?

 
sdfghjklkjhg... Scriptwright
FirefoxWindows

Save it as file.user.js and drag and drop it into the browser (firefox)
the search is not very pretty it i rather ugly i just dont feel like making a good UI for it will let someone else do that it is not hard it is just time consuming

 
Luca User
FirefoxWindows

first of all... thank you very much :)

now advanced search seems pretty long lol ... let's make it more easy,if is possible, if this not consuming too much time :)

I did not explain myslef good, sorry for it. I would like to search videos on yt like this:

Seach: ( all tipe : videos-channel-playist )
( all tipe : partner, HD )
( DATE UPLOAD: today )
( ORDER: most recent )

maybe this should help:

http://www.youtube.com/results?uploaded=d&searc...

anyway you did a great work :)

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel