Advertisement
scriptz-team

[PHP] PiNTEREST GET USER iTEMS

May 29th, 2012
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. <?php
  2. /*
  3. _____ _____ _ _____ _____ _____ _____ _____ _____
  4. ___| | __ |_| _ |_ _|___ ___|_ _| __| _ | |
  5. |_ -| --| -| | __| | | |- _|___| | | | __| | | | |
  6. |___|_____|__|__|_|__| |_| |___| |_| |_____|__|__|_|_|_|
  7. |s C R i P T z - T E A M . i N F O|
  8.  
  9. PiNTEREST GET USER iTEMS
  10. */
  11.  
  12. function pinterest_get_user_items($user)
  13. {
  14. function get_img($y, $i)
  15. {
  16. $x = explode('img src="', $y);
  17. $x = explode('"', $x[$i]);
  18. $x = $x[0];
  19. return $x;
  20. }
  21. function get_title($y, $i)
  22. {
  23. $x = explode('<title>', $y);
  24. $x = explode('</title>', $x[$i + 1]);
  25. $x = $x[0];
  26. return $x;
  27. }
  28. function get_desc($y, $i)
  29. {
  30. $x = explode('&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;', $y);
  31. $x = explode('&lt;/p&gt;</description>', $x[$i]);
  32. $x = $x[0];
  33. return $x;
  34. }
  35.  
  36. $url = "http://pinterest.com/" . $user . "/feed.rss";
  37. $ch = curl_init($url);
  38. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  39. $userAgent = '[Pinterest BOT/sCRiPTz-TEAM.iNFO;]';
  40. curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
  41. curl_setopt($ch, CURLOPT_FAILONERROR, true);
  42. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  43. curl_setopt($ch, CURLOPT_AUTOREFERER, true);
  44. curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
  45. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
  46. $content = curl_exec($ch);
  47. curl_close($ch);
  48. $count = substr_count($content, 'img src="');
  49.  
  50. for ($i = 1; $i <= $count; $i++) {
  51. $x = get_img($content, $i);
  52. $y = get_title($content, $i);
  53. $z = get_desc($content, $i);
  54. echo "TiTLE: " . $y . "<br/>";
  55. echo "iMAGE: " . str_replace("_b", "", $x) . "<br/>";
  56. echo "DESC: " . $z . "<br/><br/><br/>";
  57. }
  58. }
  59. echo pinterest_get_user_items("iconeselesse");
  60. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement