Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <?php
  2. $urls = get_all_content();
  3. $number = 0;
  4.  
  5.  
  6. foreach ($urls as $url){
  7. global $number;
  8. #some of the urls are .json files. we want to skip those
  9. if (!preg_match("/\.json$/", $url)) {
  10. echo "$url\n";
  11. find_cdn_images($url);
  12. print($number);
  13. }
  14. }
  15.  
  16. function get_all_content(){
  17. $data = json_decode(file_get_contents("https://www.northernquest.com/rebuild-cache.json"), true);
  18. return array_unique($data);
  19. }
  20.  
  21. function find_cdn_images($url){
  22. global $number;
  23. $html = file_get_contents($url);
  24. preg_match_all("/src=\"(https:\/\/78fbf27087a4dfa6b5bd-a5ec6c2236045063e04d541df309bb74.ssl.cf2.rackcdn.com\/[^\"]*)\"/", $html, $matches[1]);
  25. print_r($matches[1]);
  26. $number++;
  27. }
  28.  
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement