pastebin - collaborative debugging tool
kpaste.net RSS


Untitled
Posted by Anonymous on Fri 25th Apr 2014 20:17
raw | new post

  1. <?php
  2. header('Content-type: application/x-javascript');
  3. $url = "http://www.fbpurity.com/install.htm";
  4.  
  5. $ch = curl_init();
  6. $timeout = 5;
  7. curl_setopt($ch, CURLOPT_URL, $url);
  8. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  9. curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
  10. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  11. $data = curl_exec($ch);
  12.  
  13. $dom = new DOMDocument;
  14. @$dom->loadHTML($data);
  15. $xpath = new DOMXPath($dom);
  16.  
  17. $items = $xpath->query('//a[@title="F.B. Purity (GM Script)"]');
  18.  
  19. $fname = $items->item(0)->getAttribute("href");
  20.  
  21. $js = file_get_contents("http://www.fbpurity.com/$fname");
  22. $js = preg_replace(     "!==UserScript==!",
  23.                         "==UserScript==\n"
  24.                 .       "// @downloadURL https://torrentialstorm.net/fbpurity.user.js\n"
  25.                 .       "// @updateURL https://torrentialstorm.net/fbpurity.user.js",
  26.                         $js);
  27. echo $js;
  28.  
  29. ?>

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at