Advertisement
shutdown57

grab url blogger

Feb 19th, 2017
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. <?php
  2. function a_grabblogurl($url){
  3. @define(ch,curl_init());
  4. curl_setopt(ch,CURLOPT_URL,$url);
  5. curl_setopt(ch,CURLOPT_RETURNTRANSFER,1);
  6. curl_setopt(ch,CURLOPT_USERAGENT,"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
  7. curl_setopt(ch,CURLOPT_FOLLOWLOCATION,1);
  8. curl_setopt(ch,CURLOPT_BINARYTRANSFER,1);
  9. $exec = curl_exec(ch);
  10. preg_match_all("/http:\/\/".$url."\/[0-9]{4}\/[0-9]{2}(.*)\.html/",$exec,$u,PREG_PATTERN_ORDER);
  11. return $u;
  12. }
  13. function a_simpan($u){
  14.     $fp = fopen("list.txt","a");
  15.     fwrite($fp,$u."\n");
  16.     fclose($fp);
  17. }
  18. $url = a_grabblogurl($argv[1]);
  19. $urlx = array_unique($url[0]);
  20. foreach($urlx as $u){
  21.     echo $u. "\n";
  22.     a_simpan($u);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement