// ==UserScript== // @name TMZ Poll Results // @require http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js // @namespace http://www.webmanwalking.org/projects/greasemonkey // @description Click the poll title (example, "Who'd you rather?") to invoke TMZ's own AJAX call to display poll results. // @version 1.2 // @author WebManWalking // @license MIT License // @include http://cdn.polls.tmz.com/polls/*/iframe?stencil_id=* // // ---------------------------------------------------------------------------------------------------------------------------- // // The jQuery requirements of this script are pretty minimal, so it's better to use an older (read, smaller) version of // jquery.min.js to instantiate the click event handler. Inside the click event handler, we have to use unsafeWindow.jQuery // to pick up the copy that can invoke TMZ's script. Using simply jQuery resulted in errors. Maybe those errors were the result // of using 1.3.2 in the require header. If I have to modify the script because TMZ decides to change the URL or div id, I'll see // whether requiring a higher version of jQuery avoids the need to use unsafeWindow.jQuery. But for now, this seems good enough. // // Even if unnecessary for technical reasons, TMZ could always change their URL and div id formation rules simply to defeat this // script. But my guess and hope is, they won't bother. After all, they would just be entering into an arms-race-like mutual // escalation, with knowledgeable JavaScripters as their opponents. Better to stick with something simple that works and accept // that there will always be a tiny minority of Internet-savvy users who can get results without voting, right? We'll see. // // WebManWalking, 05/07/2011 // // Version 1.1: // // TMZ replaced
with