Change IMDB Links' Text to the Movies' Title

Last update on Jun 19, 2008

With this script, you can see to which movie an imdb link refers to without clicking it.

With this script, you can see to which movie an imdb link refers to without clicking it.

For Example: IMDB Link will become How I Met Your Mother (2005).




You could comment on this script if you were logged in.

8 comments Feed-icon

1 point
login to vote
Posted Jul 25, 2008
1 point
login to vote
Posted Jul 2, 2008

It doesn't seem to work, nothing happens. It's like I didn't had the script installed in the first place.

1 point
login to vote
dob script's author
Posted Jul 1, 2008

Try this version:

function $x(p, context) {
      	if (!context) context = document;
      	var i, arr = [], xpr = document.evaluate(p, context, null, 6, null);
      	for (i=0; item=xpr.snapshotItem(i); i++) arr.push(item);
      	return arr;
      }
      
      var links = $x("//a[contains(@href, 'imdb.com/title/')]");
      if (links.length) {
      	links.forEach(function(link,i) {
      	if (!link.hasChildNodes()) {
      			if (!GM_getValue(link.href)) {
      				GM_xmlhttpRequest({
      					method: "get",
      					url: link.href,
      					onload: rs(i)
      				});
      			}
      		}
      	});
      }
      function rs(i) {
      	return function(e) {
      		var title = e.responseText.split("<title>")[1].split("</title>")[0];
      		links[i].textContent = title;
      		GM_setValue(links[i].href, title);
      	}
      }

This is just alpha, I haven't tried it yet.

1 point
login to vote
Posted Jun 28, 2008

Thanks, but now it seems like something is wrong. The text-links doesn't change to the IMDb-title, and the images-links still changes to the IMDb-titles.

1 point
login to vote
dob script's author
Posted Jun 19, 2008

I updated the script so image links won't be changed.

1 point
login to vote
Posted Jun 19, 2008

Thanks for a very useful script, but how do I do so "jpg"- and "png"-files don't get replaced by the title?

1 point
login to vote
dob script's author
Posted Apr 25, 2008

Updated the script a little.
If the link has been changed before it will be saved, making the script work a lot faster.

Also, http://*.imdb.com will be excluded.
Thanks for the tip, Hiromacu.

1 point
login to vote
Hiromacu scriptwright
Posted Apr 7, 2008

Need to add an exclude: http://us.imdb.com/* !!

You could comment on this script if you were logged in.