Changeset 1297457
- Timestamp:
- 11/30/2015 03:22:42 PM (10 years ago)
- Location:
- wpostgrabber/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wpg_function.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpostgrabber/trunk/readme.txt
r1286272 r1297457 138 138 * Fix bug : blank content when manual / standard posting 139 139 140 = 2.0.1 = 141 * fix file_get_contents bug on some server 142 140 143 == Upgrade Notice == 141 144 … … 189 192 * Add More URL Feed 190 193 * Fix bug : blank content when manual / standard posting 194 195 = 2.0.1 = 196 * fix file_get_contents bug on some server -
wpostgrabber/trunk/wpg_function.php
r1280675 r1297457 11 11 } 12 12 } 13 14 function wpg_get($url) 15 { 16 17 $curl = curl_init(); 18 $header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,"; 19 $header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; 20 $header[] = "Cache-Control: max-age=0"; 21 $header[] = "Connection: keep-alive"; 22 $header[] = "Keep-Alive: 300"; 23 $header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7"; 24 $header[] = "Accept-Language: en-us,en;q=0.5"; 25 $header[] = "Pragma: "; 26 // browsers keep this blank. 27 $referer = "http://www.google.com"; 28 29 $btext = rand(0,100000); 30 $mozillav = rand(2,9); 31 $wow = rand(20,80); 32 $browser = "Mozilla/$mozillav.0 (Windows NT $mozillav.2; WOW$wow) AppleWebKit/$btext (KHTML, like Gecko) Chrome/$btext Safari/$btext"; 33 34 //Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.22 Safari/537.36 35 36 curl_setopt($curl, CURLOPT_URL, $url); 37 curl_setopt($curl, CURLOPT_USERAGENT, $browser); 38 curl_setopt($curl, CURLOPT_HTTPHEADER, $header); 39 curl_setopt($curl, CURLOPT_REFERER, $referer); 40 curl_setopt($curl, CURLOPT_AUTOREFERER, true); 41 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 42 curl_setopt($curl, CURLOPT_TIMEOUT, 60); 43 curl_setopt($curl, CURLOPT_MAXREDIRS, 14); 44 curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); 45 46 $data = curl_exec($curl); 47 48 curl_close($curl); 49 return $data; 50 } 51 52 13 53 14 54 function wpg_get_rss($url,$offset,$limit) { … … 49 89 50 90 function wpg_verify_api($apikey) { 51 $data = file_get_contents("http://websprogramming.com/wp-plugin/wpostgrabber/verifyapi.php?apikey=$apikey");91 $data = wpg_get("http://websprogramming.com/wp-plugin/wpostgrabber/verifyapi.php?apikey=$apikey"); 52 92 $data = json_decode($data); 53 93 if($data->api_status == 0) { … … 75 115 curl_close ($Curl_Session); 76 116 return $result; 77 } 117 } 78 118 79 119 function wpg_check_mime($url) {
Note: See TracChangeset
for help on using the changeset viewer.