Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install
YouTube Title Adder
2.0r4: Better options, version checking, inline embedding. YouTube's URL format means you click videos blindly. This appends the title of a YouTube link to the link in the referring page. Fixed some links with referrers (see screens)
6/07/08
Found out that some URLs weren't working if they were not a direct YouTube link (like a FARK 'referred' link).
So, now this script just parses the 11-digit video code from a YouTube URL and fetches that, regardless of the parameters of the originating link.
5/13/08
Thanks to inspiration from the excellent Google Anonymizer Script, I made the settings be its own window, as opposed to toggling Greasemonkey menus. You can access the 3 options from "Tools...GreaseMonkey...User Scripts Commands...YouTube Title Adder Options".
Also, online version checking has been implemented!
In the above mentioned "YouTube Title Adder Options" window, it will check this page for the latest version of the script, and present a link in the options menu should one be available! (See Screens)
I think it'll work fine, but comment if it doesn't!
(if you find this script useful, I accept TotalFark sponsorships to help waste my time. figured that was worth a shot, like this:
)


5/11/08
Please uninstall your old script, as I've changed the name to cease having that version # that's never changing.
Contains a fix for if an image link has a title already (like Fark's YouTube buttons), plus a better title adding method.
4/10/08
New Addition! Inline switchable embedding!
I got sick of wondering if a link will "pop" or not, and also just don't really enjoy loading YouTube's pages when I just want to see the video and be on my merry way... so, I added the ability to just click a small image button, placed next to the link, to show/hide the video while in the same page! It's unobtrusive, and the video will only load if you click the "show" button... so there's no page load slowdown!
If embedding is disabled for a video (like the samples on this page), you can click the icon to at least see the video thumbnail.
It can be toggled in the "User Script Commands"
See screen shots below!
3/14/08
Yet another fix... why can't layouts stay the same?
1/10/08
Updated to fix YouTube's removal of the "div" for a title, and placing it instead in the meta head. Should work again!
10/05/07
That was easy. Added the ability to toggle the titles on Text/Image links via the GreaseMonkey...User Script Commands... menu.
10/04/07
Doesn't append the innerHTML if the link is an image button (like on Fark). Test here:
This should have no text appended, but show you the video name when you mouseover: 
This should be appended as per usual: Video
What I'd like to do next is make the selections have toggles, so you can set it to append text, do the mouseovers, etc. I'll get on that for the hell of it soon.
v1.2 - 9/29/07
Thanks to all who have downloaded this; it's my fastest propagating script yet. Please spread the word! I have discovered some YouTube videos apparently use a < div > to display the video title, so I had to put in an alternate fetching should the more popular header method return nothing.
In other words, I got Rick Roll'd on a Youtube link (that should tell you what the video is, btw), and was forced to update this script.
Also, contrary to a post below, this script really does not affect page loads at all. Before I did the exclusion of Google searches and YouTube's page, it would fetch titles for every video on those pages. Everything still loaded great!
Please leave any suggestions or requests in the comments, as I really am happy with how this script turned out.
v1 - 9/9/07 - Initial release
One pet peeve on the web for me is the format of YouTube's links being so obscure that you have no clue what the hell you're clicking on half the time.
This script goes through a page, seeks out the YouTube links, grabs the YouTube video's title, and appends the title to the link in the page.
It bolds the title, italicizes the link, and modifies the title.
No you have no excuse for not knowing what you're clicking on.
Before:
After:


|
|
I recommend adding the following lines directly before the var w=videoname[1].toLowerCase().split(/\s*\b\s*/);
var v=link.innerHTML.replace(/<[^>]+>/gi,"").toLowerCase().split(/\s*\b\s*/).filter(function(t){return t.length>2});
if(v.filter(function(t){return w.indexOf(t)!=-1}).length/v.length>0.5) return;
This checks if the link already has the correct name, and then doesn't change it if it does. I have mine set up to change the 'mouseover' text regardless. |
|
|
It looks like those pages need to be added to the exclude list. What's the URL of a favorites page? I don't use YouTube really (hence my hatred of blind links), and definitely don't use it enough to have an account and page on it... so I just exclude pages that affect me. you can add in the excluded pages under greasemonkey...manage user scripts... and select the YouTube Title Adder and click "Add" under the "the following sites are excluded..." box. |
|
|
Here are some screenshots that might help explain: Before installation: http://img136.imageshack.us/img136/1060/ytfavs8... http://img50.imageshack.us/img50/8118/ytsubs888... http://img136.imageshack.us/img136/679/ytvid888... After: http://img136.imageshack.us/img136/4059/ytvid99... |
|
|
I wanted to use it on YouTube. The problem is that the "Subscriptions", "My Videos", and "Favorites" pages only show half the title or so for each video, so you never know what each video actually is before clicking on it. They don't even have a hover feature. That's the main reason this script interested me. Then when you watch a YouTube video on the YouTube site, there are links to other videos and all the titles get appended to and the whole page is a huge mess. You can barely read the comments or anything. I've tried messing with the script but I'm programming illiterate so I broke it. I'll try again though. Do you know if there is a way to just extend the file name rather than append to it? Or maybe erase the original file name at least partially and just view the appendage? |
|
|
{ link.innerHTML = '' + link.innerHTML + " (YT: " + videoname[1] + ")"; } That is how it outputs after a link. You can play with that for formatting. As far as showing up for "many links on the site", I am not sure what you mean. You may just want to add an exclusion in Greasemonkey for specific sites if it's a bother. Right now, it excludes:
|
|
|
Is there any way I can remove the first part of the title and just display the "(YT:" part? Then is there anyway I can remove the "(YT:" part so just the title appears? Also, the "(YT:" links are appended to many links on the site and the page is filled with them. I really want something like this - I even made a forum post about it - but this is much too buggy. |
|
|
Also stopped working for me. I tried uninstall/reinstall, still not working. |
|
|
Hmm, it recently stopped working for me. Not sure if it's the scripts problem or my own. |
|
|
Unbelievable! Thank you!!! |
|
|
You can comment out the line:
|
|
|
I am loving this script! However it also adds titles to image links which tends to mess up the layout of pages. It would be a really nice addition to make the YT titles optionally show only in mouse-over tips - for text links too :) Just my two cents :] |
|
|
You know, doing all these scripts I never caught on to changing the Title = having to uninstall old one (since I just upload the script by pasting the source code from my machine). I apologize to all for having to uninstall/reinstall. I'll keep it titled as "1.2" from now on, even if i make changes. Thanks for the heads up! |
|
|
Yes you were right, didn't notice any change in load times. You shouldn't change the name of the script though, makes upgrading more complicated as users have to uninstall the previous version. |
|
|
You'd be surprised how it really doesn't. |
|
|
I bet this damages pageloads a lot |
|
|
Inspired idea and great work. Highly recommended to all reading this page. |
You could comment on this script if you were logged in.
