Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. // ==UserScript==
  2. // @name duel line google search
  3. // @version 3.14
  4. // @description search 2 line from a hit on google
  5. // @updateurl http://userscripts.org/
  6. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
  7. // @match https://s3.amazonaws.com/*
  8. // @match https://www.mturkcontent.com/*
  9. // @grant none
  10. // @copyright no thanks i'm full
  11. // ==/UserScript==
  12.  
  13. //store links for iframe src
  14. var dealurl = "http://www.google.com/search?q=";
  15. var query = encodeURIComponent($("td").eq(1).text());
  16. var address = encodeURIComponent($("td").eq(5).text());
  17.  
  18. dealurl += query + ' ' + address + ' ' ;
  19.  
  20.  
  21. //focus before new page opens
  22. $("input[name=web_url]").focus();
  23.  
  24.  
  25. //get screen dimensions, divide width, open and position new window, return focus
  26. var w = screen.availWidth/2;
  27. var h = screen.availHeight;
  28. myWindow = window.open(dealurl, 'Search Page', 'width='+w+', height='+h+', scrollbars=yes, toolbar=yes');
  29. myWindow.moveTo(w,0);
  30. myWindow.blur();
  31. self.focus();
  32. $('#mturk_form').submit(function(evt){
  33. myWindow.close();
  34. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement