Advertisement
austinh115

[PHP] prntscr grabber (i think) cURL

Jul 28th, 2016
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. <?php
  2. $url = "http://image.prntscr.com/image/bfd913bdb90b4877b806e538befffc63.png";
  3.  
  4. $file = fopen(".".parse_url($url)["path"], 'w');
  5.  
  6. $ch =  curl_init();
  7. curl_setopt($ch, CURLOPT_URL, $url);
  8. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  9. curl_setopt($ch, CURLOPT_AUTOREFERER, true);
  10. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  11. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
  12. curl_setopt($ch, CURLOPT_FILE, $file);
  13. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36');
  14.  
  15. curl_exec($ch);
  16.  
  17. curl_close($ch);
  18. fclose($file);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement