Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function a_grabblogurl($url){
- @define(ch,curl_init());
- curl_setopt(ch,CURLOPT_URL,$url);
- curl_setopt(ch,CURLOPT_RETURNTRANSFER,1);
- curl_setopt(ch,CURLOPT_USERAGENT,"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
- curl_setopt(ch,CURLOPT_FOLLOWLOCATION,1);
- curl_setopt(ch,CURLOPT_BINARYTRANSFER,1);
- $exec = curl_exec(ch);
- preg_match_all("/http:\/\/".$url."\/[0-9]{4}\/[0-9]{2}(.*)\.html/",$exec,$u,PREG_PATTERN_ORDER);
- return $u;
- }
- function a_simpan($u){
- $fp = fopen("list.txt","a");
- fwrite($fp,$u."\n");
- fclose($fp);
- }
- $url = a_grabblogurl($argv[1]);
- $urlx = array_unique($url[0]);
- foreach($urlx as $u){
- echo $u. "\n";
- a_simpan($u);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement