Created
February 6, 2011 22:15
-
-
Save wvega/813771 to your computer and use it in GitHub Desktop.
An User script to show IMBD links in Google Reader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name IMDB Link | |
| // @namespace wvega.com | |
| // @description Add a link to the IMDB page of the movies listed in your feeds*. | |
| // @include https://www.google.com/reader/view/* | |
| // @require http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js | |
| // ==/UserScript== | |
| (function($, undefined) { | |
| var refresh = $('#viewer-refresh'), imdb = refresh.clone(), | |
| regexp = new RegExp('^([^[]+).*FXG'); | |
| refresh.parent().append(imdb); | |
| imdb.find('.goog-button-body').text('IMDB').end().click(function(){ | |
| $('.entry-title').each(function() { | |
| var h2 = $(this), title = h2.text(), matches; | |
| if (!h2.hasClass('imdb-ready') && (matches = title.match(regexp)) !== null) { | |
| h2.after('<a class="imdb-page-link" href="http://www.imdb.com/find?q=' + matches[1] + '" target="_blank" style="margin-left: 10px">IMDB Page</a>'); | |
| h2.addClass('imdb-ready'); | |
| } | |
| }); | |
| }); | |
| })(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment