Rar!ϐs t 2FFt5;30 imdb_functions.phpUser Rating:", $page); $chunk = split("alt=\"Vote Here\" align=\"bottom\"",$chunk[1]); $leftover = $chunk[0]; $rating_regex = "([0-9]+.[0-9]+)/10 \((([0-9]+,)?[0-9]+) votes\)"; eregi($rating_regex,$leftover,$match); if (!empty($match)) return $match; else return ""; } function get_movie_page($movie_id) { // Define the search url $search_url = "http://us.imdb.com/title/tt$movie_id"; return get_html($search_url); } function find_movie($movie,$year,$page,$extend) { $matches = array(); $matches = find_movie_reg($movie,$year,$page,$extend); if (empty($matches)) { $matches = find_movie_aka($movie,$year,$page,$extend); } else return $matches; return $matches; } function find_movie_reg($movie,$year,$page,$extend) { $matches = array(); // onclick="set_args('tt0255798',1,1)">The Animal (2001) // Set regular expression if (eregi("and|&",$movie)) { $movie = eregi_replace("and|&","(and|&)",$movie); } //$movie_spc = htmlspecialchars($movie); if ($extend) $regex = "onclick=\"set_args\('tt[0-9]+',[0-9]+,[0-9]+\)\">.*$movie?.* \($year(/|\))"; else $regex = "onclick=\"set_args\('tt[0-9]+',[0-9]+,[0-9]+\)\">$movie \($year(/|\))"; if (eregi($regex,$page)) { eregi($regex,$page,$matches); } return $matches; } function find_movie_aka($movie,$year,$page,$extend) { $matches = array(); // (2004)
 aka "Head-On" //$movie_spc = htmlspecialchars($movie); if (eregi("and|&",$movie)) { $movie = eregi_replace("and|&","(and|&)",$movie); } if ($extend) $regex = "onclick=\"set_args\('tt[0-9]+',[0-9]+,[0-9]+\)\">.*? \($year\).*
? aka \".*$movie?.*\"?"; else $regex = "onclick=\"set_args\('tt[0-9]+',[0-9]+,[0-9]+\)\">.*? \($year\).*
? aka \"$movie\""; if (eregi($regex,$page)) { eregi($regex,$page,$matches); } return $matches; } ?>*At 4pU40 netflix.user.jsb]O// ==UserScript== // @name IMDb/TV.com Ratings in Netflix // @namespace http://www.inthevoid.com/gm/imdb/ // @description Adds IMDb/TV.com ratings/votes to Netflix pages. // @include http://www.netflix.com/* // @include http://netflix.com/* // ==/UserScript== /** This script calls a php script which attempts to find the rating/votes of the current movie. ** For those of you wondering whether a movie is good enough to rent, this is for you. ** Also, it should be helpful when browsing /AllNewReleases as there are many that you may ** want to check. I am not sure how much bandwidth this script will take up, but if anyone ** has a better host to host the remote script on, any help would be appreciated. ** ** This script is losely based on, and is in complement to, "Netflix Links in IMDb" ** http://www.artefxdesign.com/greasemonkey ** ** This in turn is also based on "IMDb Links in Netflix" ** http://www.j-san.net/code/greasemonkey ** ** for questions, bugs, compliments, etc.: http://www.inthevoid.com/gm ** ** This is a greasemonkey script, intended for use with the Firefox extension Greasemonkey. ** More info: http://greasemonkey.mozdev.org/ **/ (function() { var url = "http://www.inthevoid.com/gm/imdb/imdb.php"; /* get the Movie Title from the current Netflix page */ function getMovieTitle() { /* We're going to find the Movie Title from the title in the HEAD section. It's the easiest place to find the info. We just have to strip off the "Netflix: " */ var movietitle = document.title.slice(9); return movietitle; } /* given the movie title, let's make a url */ function makeIMDbUrl(movietitle) { var imdburl = 'http://www.imdb.com/find?q='+ movietitle +';tt=on;nm=on;mx=20;'; return imdburl; } function getMovieYear() { var year = getSpanYear(); var year = year.substr(1,4); return year; } function makeIMDbLink(movietitle,movierating,movievotes) { var container = document.createElement("span"); container.appendChild(document.createTextNode(" ")); var newLink = document.createElement("a"); newLink.setAttribute("href", encodeURI(makeIMDbUrl(movietitle))); newLink.setAttribute("target", "netflix"); newLink.appendChild(document.createTextNode("(IMDb)")); container.appendChild(newLink); container.appendChild(document.createElement("br")); container.appendChild(document.createElement("br")); var boldness = document.createElement("b"); boldness.appendChild(document.createTextNode("IMDb Rating: ")); container.appendChild(boldness); container.appendChild(document.createTextNode(movierating)); container.appendChild(document.createElement("br")); boldness = document.createElement("b"); boldness.appendChild(document.createTextNode("IMDb Votes: ")); container.appendChild(boldness); container.appendChild(document.createTextNode(movievotes)); return(container); } function makeTVLink(movietitle,tvrating) { var container = document.createElement("span"); container.appendChild(document.createElement("br")); container.appendChild(document.createElement("br")); var boldness = document.createElement("b"); boldness.appendChild(document.createTextNode("TV.com Rating: ")); container.appendChild(boldness); container.appendChild(document.createTextNode(tvrating)); return(container); } function getSpanYear() { var descContent = document.getElementById("description-content"); var els = descContent.getElementsByTagName("span"); var elsLen = els.length; var searchClass = "year"; var pattern = new RegExp("\\b"+searchClass+"\\b"); for (i = 0, j = 0; i < elsLen; i++) { if ( pattern.test(els[i].className) ) { return ( els[i].firstChild.nodeValue ); } } return ""; } function insertIMDbLinks() { var title = getMovieTitle(); var year = getMovieYear(); newurl = url + "?t=" + escape(title) + "&y=" + escape(year); GM_xmlhttpRequest({ method: "GET", url:newurl, onload:function(result) { var dom = new XPCNativeWrapper(window, "DOMParser()"); var parser = new dom.DOMParser(); var xmlDoc = parser.parseFromString(result.responseText, "text/xml"); var type = xmlDoc.getElementsByTagName("type")[0].textContent; var rating = xmlDoc.getElementsByTagName("rating")[0].textContent; if (type == "movie") { var votes = xmlDoc.getElementsByTagName("votes")[0].textContent; } for (var i=0; i < document.links.length; i++) { var a = document.links[i]; var href = a.getAttribute("href"); if (href.indexOf('#details') >= 0) { if (type == "movie") a.parentNode.appendChild(makeIMDbLink(title,rating,votes)); else if (type == "series") a.parentNode.appendChild(makeTVLink(title,rating)); } } } }); } insertIMDbLinks(); })(); 2t 5-b40 tv_functions.phph&Lost //Lost (2001) $sections = explode("",$sections[1]); if ($extend) $regex = ".*$series?.*"; else $regex = "$series"; if (eregi($regex,$sections[0],$matches)) { return $matches; } else return array(); } function get_tv_page($link) { // Define the search url $search_url = "http://www.tv.com/$link"; return get_html($search_url); } function get_tv_rating($page) { if (!strstr($page,"")) return ""; $chunk = split("",$page); $chunk = split("",$chunk[1]); return trim($chunk[0]); } ?>$t 2rr;30 html_functions.phpJgt ( dHv;30 imdb.php 60 || strlen($year) > 5) die("Nuh uh..."); //echo $movie; //$movie = "The Dead Zone: Season 3"; //$year = "2000"; $ratings = array(); $rating = ""; $votes = ""; if (is_series($movie)) { // Remove season $movie = remove_editions($movie); $search = get_tv_search_results($movie); $matched = find_series($movie,$search,false); if (!empty($matched)) { // if (eregi("show/[0-9]+/summary.html",$matched[0],$link)) { $page = get_tv_page($link[0]); $rating = get_tv_rating($page); if (empty($rating)) $rating = "Not found"; } } else $rating = "Not found"; $return_value = 'series'.$rating.''; header('Content-Type: text/xml'); echo $return_value; } else { // Remove extended/special... $movie = remove_editions($movie); $search = get_imdb_search_results($movie); if (eregi("User Rating:",$search)) { $ratings = get_rating($search); if (empty($ratings)) { $rating = "Waiting for votes."; $votes = "Waiting for votes."; } } else { $matched = find_movie($movie,$year,$search,false); if (empty($matched)) $matched = find_movie($movie,($year-1),$search,false); if (empty($matched)) $matched = find_movie($movie,($year+1),$search,false); if (empty($matched)) $matched = find_movie($movie,$year,$search,true); if (empty($matched)) $matched = find_movie($movie,($year-1),$search,true); if (empty($matched)) $matched = find_movie($movie,($year+1),$search,true); if (!empty($matched)) { eregi("tt[0-9]+",$matched[0],$id); if (!empty($id)) { $id = $id[0]; $id = str_replace("tt","",$id); $page = get_movie_page($id); $ratings = get_rating($page); if (empty($ratings)) { $rating = "Waiting for votes."; $votes = "Waiting for votes."; } } } } if (!empty($ratings) && !empty($ratings[1]) && !empty($ratings[2])) { $rating = $ratings[1]; $votes = $ratings[2]; } else if (empty($ratings) && empty($rating) && empty($votes)) { $rating = "Not found"; $votes = "Not found"; } //echo "
rating: " . $rating; //echo "
votes: " . $votes; $return_value = 'movie'.$rating.''.$votes.''; header('Content-Type: text/xml'); echo $return_value; } ?>={@