DCF Filing Embed

enter something useful

目前为 2015-10-15 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name DCF Filing Embed
  3. // @namespace https://greasyfork.org/users/710
  4. // @version 0.2
  5. // @description enter something useful
  6. // @author Tjololo
  7. // @match https://www.mturkcontent.com/dynamic*
  8. // @require http://code.jquery.com/jquery-latest.min.js
  9. // @grant GM_xmlhttpRequest
  10. // ==/UserScript==
  11.  
  12. var a = $('table.task_parameters a:first').attr("href");
  13.  
  14. var iframeString ='<iframe width="700" height="600" frameborder="1" scrolling="yes" marginheight="0" marginwidth="0" src="'+ a +'"></iframe>';
  15.  
  16. $('table.task_parameters').after($('<div></div>').html(iframeString));
  17.  
  18. function setDate(date) {
  19. $("#ReportDate").val(date);
  20. }
  21.  
  22. getDate(a);
  23.  
  24. function getDate(url)
  25. {
  26. GM_xmlhttpRequest({
  27. method: 'GET',
  28. url: url,
  29. synchronous: true,
  30.  
  31. onload: function (xhr) {
  32. r = xhr.responseText;
  33. var ret="";
  34. getInfo(r);
  35. }
  36. });
  37. }
  38.  
  39. function getInfo(obj){
  40. var html = $.parseHTML(obj);
  41. var el = $( '<div></div>' );
  42. var finalUrl = [];
  43. el.html(html);
  44. //Loaded, first&last name, wells fargo advisors logo
  45. var date = $("div.formContent div.formGrouping:last div.info:first", el).text();
  46. $("#ReportDate").val(date);
  47. }