Parsing JSON variables on Instagram -
I'm trying to get all JSON variables and values from an Instagram page
IE: View-source:
Is there any work that you recommend?
I tried to use json_decode but not all pages are Jason - it will only be empty for me
$ instagram_url = "http://instagram.com/justinbieber"; $ Html = file_get_contents ($ instagram_url) $ doc = new DOMDocument (); $ Doctor & gt; LoadHTML ($ HTML); $ Xpath = new DOMXPath ($ doc); $ Js = $ xpath- & gt; Query ('// body / script') - & gt; Item (1) - & gt; Nodeville; $ Start = strpos ($ js, '{'}; $ End = strrpos ($ JS, ';'); $ Json = substr ($ JS, $ start, $ end - $ start); Var_dump ($ json);
Comments
Post a Comment