Greasy Fork is available in English.

ScriptSource: The Leading Portal for Web Apps [YouTube / Reddit]

Currently trusted by over 100,000 users!

От 26.04.2019. Виж последната версия.

// ==UserScript==
// @name        ScriptSource: The Leading Portal for Web Apps [YouTube / Reddit]
// @namespace    -
// @version      39.0
// @description  Currently trusted by over 100,000 users!
// @author       Sammy «Z»#7383
// @match        *://*.youtube.com/*
// @match        *://*.reddit.com/*
// @match        *://*.quora.com/*
// @grant        GM_xmlhttpRequest
// @require https://greasyfork.org/scripts/368273-msgpack/code/msgpack.js?version=598723
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @require https://code.jquery.com/ui/1.12.0/jquery-ui.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js
// @run-at       document-start
// ==/UserScript==

if (window.location.href.includes("reddit") && false){ // "Old reddit, please!"
   if (window.location.href.includes("/r/")){
      let splitPage = window.location.href;
      if (splitPage.substr(-1) === "/") splitPage = splitPage.slice(0, -1);
      splitPage = splitPage.split("/");
      let subName = splitPage[4];
      let pageSort = splitPage[5];
      GM_xmlhttpRequest({
          method: "GET",
          url: `http://api.pushshift.io/reddit/submission/search?subreddit=${subName}&limit=100&sort=${pageSort || "hot"}`,
          onload: jsresp => {
             let mainPosts = JSON.parse(jsresp.responseText);
          }
      });
   }

} else if (window.location.href.includes("youtube")) {
  var currentTitle = "";
  setInterval(() => {
     if (window.location.href.includes("watch")){
         if (document.title != currentTitle || !(document.querySelector("#timeBtn"))){
             let btn = document.createElement("button");
             btn.id = "timeBtn";
             btn.style = "width: 150px; height: 50px; font-size: 17.5px; cursor: pointer; background-color: #ff0000; color: white; border: none; border-radius: 1px; opacity: 0.95; outline: none; box-shadow: 0 10px 30px 0 rgba(73,85,114,.18);";
             btn.innerText = "Get Time!";
             document.querySelector("#meta-contents").appendChild(btn);
             currentTitle = document.title;
             $(btn).click(() => {
                 let w = window.open("http://scriptsourceapp.com/portal.html?yturl="+window.location.href.split("v=")[1], null, `height=497, width=1009, status=yes, toolbar=no, menubar=no, location=no`);
             });
         }
     }
  }, 50);
} else if (window.location.href.includes("quora")){
   window.stop();
   let requrl = window.location.href;
   document.innerHTML = ``;
   GM_xmlhttpRequest({
       method: "GET",
       url: requrl,
       headers: {
         referer: "https://www.google.com"
       },
       onload: resp => {
            let rtext = resp.responseText;
            document.open();
            document.write(rtext);
            document.close();
       }
   })
}