Guest User

Untitled

a guest
Mar 15th, 2018
1,186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. case 'instagram':
  2. $td_data = td_remote_http::get_page("http://instagram.com/$user_id#", __CLASS__);
  3. //$pattern = "/followed_by\":(.*?),\"follows\":/";
  4. //$pattern = "/followed_by\"\:\{\"count\"\:(.*?)\}\,\"/";
  5.  
  6. // get the serialized data string present in the page script
  7. $pattern = '/window\._sharedData = (.*);<\/script>/';
  8. preg_match($pattern, $td_data, $matches);
  9. if (!empty($matches[1])) {
  10. $instagram_json = json_decode($matches[1], true);
  11. if (!empty($instagram_json['entry_data']['ProfilePage'][0]["graphql"]['user']["edge_followed_by"]['count'])) {
  12. $buffy_array = (int) $instagram_json['entry_data']['ProfilePage'][0]["graphql"]['user']["edge_followed_by"]['count'];
  13. }
  14.  
  15. }
  16. break;
Advertisement
Add Comment
Please, Sign In to add comment