Advertisement
Guest User

Untitled

a guest
Jul 15th, 2013
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. <h1>Blekko</h1>
  2.  
  3. <?php
  4.  
  5. $cerv = 'http://blekko.com/ws/?q=cervantes+/json&auth=f4c8acf3';
  6. $fx = curl_init();
  7.  
  8. curl_setopt($fx, CURLOPT_URL, $cerv);
  9. curl_setopt($fx, CURLOPT_RETURNTRANSFER, $cerv);
  10.  
  11. $newdata = curl_exec($fx);
  12. curl_close($fx);
  13.  
  14. $json = json_decode($newdata);
  15. var_dump($json->{'newitems'});
  16.  
  17. foreach($json->{'newitems'} as $newitems)
  18. {
  19.     echo $newitems->{'url_title'}. ": ".$newitems->{'snippet'}."<br>";
  20. }
  21. /*
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement