Instagram API?

  • Moin, irgendwie gerade am verzweifeln. Möchte ein bestimmtes Bild einbinden von Instagram mit einer media ID.


    Code
    $token = $data->access_token;
    $info = 'https://api.instagram.com/v1/media/3?access_token=Hierderaccesstokenvonmir'; //die 3 ist nun die Media ID von irgendeinem Bild welches auch existiert
    echo $token."</br>"; //Gibt den richtigen Access Token aus
    $response = json_decode($info, true);
    echo $info."</br>";//Gibt NICHTS aus..
    echo $response."</br>";//Gibt NICHTS aus..
    $fullsize = $response['images']['standard_resolution']['url'];
    echo $fullsize."</br>";//Gibt NICHTS aus.. (sollte ja die URL des Bildes sein)
    echo '<img src="'.$fullsize.'"/>';


    Media ID 3 wäre soweit ich richtig liege folgendes öffentliches Bild:
    http://distillery.s3.amazonaws…372843a7eb33fa41cad_7.jpg


    Nur wird nichts ausgegeben. Wo ist der Fehler?


    Auch mit der folgenden Variante klappt es nicht, diese Funktionen stehen zur Verfügung:


    Hoffe jemand findet den Fehler..


    Advertising has us chasing cars and clothes, working jobs we hate so we can buy shit we don’t need.
    – Tyler Durden


    Sobald Werbung im Spiel ist, bist du, die Nutzerin, der Nutzer, das Produkt.


  • Schon mal einen Schritt weiter, danke!


    Nun erhalte ich wie gewünscht den Code:

    Code
    {"meta":{"code":200},"data":{"attribution":null,"tags":[],"type":"image","location":null,"comments":{"count":112,"data":[{"created_time":"1384645327","text":"Second pic lol","from":{"username":"animals_video","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/profile_507102035_75sq_1387769248.jpg","id":"507102035","full_name":"Animals Videos"},"id":"590770287964853240"},{"created_time":"1384982100","text":"\u0628\u0633 \u0628\u062a\u0642\u0639\u062f\u0648 \u0646\u062d\u0633\u0628\u0648\u0646 \u062c\u0645 \u0635\u0648\u0631\u0629","from":{"username":"rana_algayeb","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/profile_286790517_75sq_1367356991.jpg","id":"286790517","full_name":"rana_algayeb"},"id":"593595338439266652"},{"created_time":"1385205364","text":"@doom_aldhaheri  second picture on Instagram","from":{"username":"gum_22","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/profile_374082553_75sq_1368222715.jpg","id":"374082553","full_name":"GUM"},"id":"595468215333687987"},{"created_time":"1385589399","text":"\u0647\u0647\u0647\u0647\u0647\u0647 \u062a\u062a\u0648\u0642\u0639 @mishary98f","from":{"username":"o__0e","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/profile_659478167_75sq_1385828508.jpg","id":"659478167","full_name":"\u0627\u0646\u0627\u0642\u0647"},"id":"598689736361513715"},{"created_time":"1386962839","text":"\u0647\u0647\u0647\u0647\u0647\u0647\u0647\u0647","from":{"username":"younis4433","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/profile_316936249_75sq_1386241067.jpg","id":"316936249","full_name":"^\u064a\u0648\u0646\u0633^"},"id":"610210979120157002"},{"created_time":"1387797789","text":"\u0648\u0644\u0644\u0647 \u0637\u0644\u0639\u0646\u0627 \u0630\u064a\u0627\u0628\u0629 \u0627\u0644\u0639\u0631\u0628 \u063a\u0632\u0648\u0627 \u0635\u0641\u062d\u0629 \u062d\u0633\u0627\u0628\u0647 \u0647\u0647\u0647\u0647\u0647\u0647","from":{"username":"maged_boqami","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/profile_823160050_75sq_1388318130.jpg","id":"823160050","full_name":"\u0645\u0627\u062c\u062f \u0627\u0644\u0628\u0642\u0645\u064a"},"id":"617215047529140229"},{"created_time":"1388140778","text":"\u062b\u0627\u0646\u064a \u0635\u0648\u0631\u0629 \u0641\u064a \u0627\u0644\u0627\u0646\u0633\u062a\u063a\u0631\u0627\u0645","from":{"username":"m_h_i_you","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/profile_334386359_75sq_1387718155.jpg","id":"334386359","full_name":"moadah Al_omran"},"id":"620092251623657537"},{"created_time":"1388321855","text":"\u062b\u0627\u0646\u064a \u0635\u0648\u0631\u0629 \u062e\u062e","from":{"username":"wafooya1987","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/profile_213165764_75sq_1388230090.jpg","id":"213165764","full_name":"wafooya1987"},"id":"621611236877931175"}]},"filter":"Normal","created_time":"1279315783","link":"http:\/\/instagram.com\/p\/D\/","likes":{"count":8407,"data":[{"username":"faisalxdf","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/profile_490901376_75sq_1385320759.jpg","id":"490901376","full_name":"~^\u0645\u0640\u0640\u0639\u0640\u0640\u0644\u0640\u0640\u0648\u0645\u0640\u0640\u0627\u062a~^ \u2728\u2764"},{"username":"bndosh_malik","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/profile_543199489_75sq_1388338175.jpg","id":"543199489","full_name":"bndosh_malik"},{"username":"falajmanii","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/profile_419661285_75sq_1387552427.jpg","id":"419661285","full_name":"Fatima Jassem"},{"username":"abohmod00","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/profile_606397926_75sq_1384546316.jpg","id":"606397926","full_name":"\u2661\u0627\u0644\u0647\u0644\u0627\u0644..\u0628\u0631\u0634\u0644\u0648\u0646\u0629\u2665"}]},"images":{"low_resolution":{"url":"http:\/\/distillery.s3.amazonaws.com\/media\/2010\/07\/16\/4de37e03aa4b4372843a7eb33fa41cad_6.jpg","width":306,"height":306},"thumbnail":{"url":"http:\/\/distillery.s3.amazonaws.com\/media\/2010\/07\/16\/4de37e03aa4b4372843a7eb33fa41cad_5.jpg","width":150,"height":150},"standard_resolution":{"url":"http:\/\/distillery.s3.amazonaws.com\/media\/2010\/07\/16\/4de37e03aa4b4372843a7eb33fa41cad_7.jpg","width":612,"height":612}},"users_in_photo":[],"caption":null,"user_has_liked":false,"id":"3_3","user":{"username":"kevin","website":"","profile_picture":"http:\/\/images.ak.instagram.com\/profiles\/profile_3_75sq_1325536697.jpg","full_name":"Kevin Systrom","bio":"","id":"3"}}}


    Nach dem decoden ist dieser Array vorhanden:


    Doch wenn ich $response['images']['standard_resolution']['url'] verwende gibt der mir nichts aus, wo liegt nun das Problem?


    Advertising has us chasing cars and clothes, working jobs we hate so we can buy shit we don’t need.
    – Tyler Durden


    Sobald Werbung im Spiel ist, bist du, die Nutzerin, der Nutzer, das Produkt.


  • Code
    Array ( [meta] => Array ( [code] => 200 ) [data] => Array ( [attribution] => [tags] => Array ( ) [type] => image [location] => [comments] => Array ( [count] => 112 [data] => Array ( [0] => Array ( [created_time] => 1384645327 [text] => Second pic lol [from] => Array ( [username] => animals_video [profile_picture] => http://images.ak.instagram.com/profiles/profile_507102035_75sq_1387769248.jpg [id] => 507102035 [full_name] => Animals Videos ) [id] => 590770287964853240 ) [1] => Array ( [created_time] => 1384982100 [text] => بس بتقعدو نحسبون جم صورة [from] => Array ( [username] => rana_algayeb [profile_picture] => http://images.ak.instagram.com/profiles/profile_286790517_75sq_1367356991.jpg [id] => 286790517 [full_name] => rana_algayeb ) [id] => 593595338439266652 ) [2] => Array ( [created_time] => 1385205364 [text] => @doom_aldhaheri second picture on Instagram [from] => Array ( [username] => gum_22 [profile_picture] => http://images.ak.instagram.com/profiles/profile_374082553_75sq_1368222715.jpg [id] => 374082553 [full_name] => GUM ) [id] => 595468215333687987 ) [3] => Array ( [created_time] => 1385589399 [text] => هههههه تتوقع @mishary98f [from] => Array ( [username] => o__0e [profile_picture] => http://images.ak.instagram.com/profiles/profile_659478167_75sq_1385828508.jpg [id] => 659478167 [full_name] => اناقه ) [id] => 598689736361513715 ) [4] => Array ( [created_time] => 1386962839 [text] => هههههههه [from] => Array ( [username] => younis4433 [profile_picture] => http://images.ak.instagram.com/profiles/profile_316936249_75sq_1386241067.jpg [id] => 316936249 [full_name] => ^يونس^ ) [id] => 610210979120157002 ) [5] => Array ( [created_time] => 1387797789 [text] => ولله طلعنا ذيابة العرب غزوا صÙحة حسابه هههههه [from] => Array ( [username] => maged_boqami [profile_picture] => http://images.ak.instagram.com/profiles/profile_823160050_75sq_1388318130.jpg [id] => 823160050 [full_name] => ماجد البقمي ) [id] => 617215047529140229 ) [6] => Array ( [created_time] => 1388140778 [text] => ثاني صورة ÙÙŠ الانستغرام [from] => Array ( [username] => m_h_i_you [profile_picture] => http://images.ak.instagram.com/profiles/profile_334386359_75sq_1387718155.jpg [id] => 334386359 [full_name] => moadah Al_omran ) [id] => 620092251623657537 ) [7] => Array ( [created_time] => 1388321855 [text] => ثاني صورة خخ [from] => Array ( [username] => wafooya1987 [profile_picture] => http://images.ak.instagram.com/profiles/profile_213165764_75sq_1388230090.jpg [id] => 213165764 [full_name] => wafooya1987 ) [id] => 621611236877931175 ) ) ) [filter] => Normal [created_time] => 1279315783 [link] => http://instagram.com/p/D/ [likes] => Array ( [count] => 8407 [data] => Array ( [0] => Array ( [username] => faisalxdf [profile_picture] => http://images.ak.instagram.com/profiles/profile_490901376_75sq_1385320759.jpg [id] => 490901376 [full_name] => ~^مــعــلــومــات~^ ✨⤠) [1] => Array ( [username] => bndosh_malik [profile_picture] => http://images.ak.instagram.com/profiles/profile_543199489_75sq_1388338175.jpg [id] => 543199489 [full_name] => bndosh_malik ) [2] => Array ( [username] => falajmanii [profile_picture] => http://images.ak.instagram.com/profiles/profile_419661285_75sq_1387552427.jpg [id] => 419661285 [full_name] => Fatima Jassem ) [3] => Array ( [username] => abohmod00 [profile_picture] => http://images.ak.instagram.com/profiles/profile_606397926_75sq_1384546316.jpg [id] => 606397926 [full_name] => ♡الهلال..برشلونة♥ ) ) ) [images] => Array ( [low_resolution] => Array ( [url] => http://distillery.s3.amazonaws.com/media/2010/07/16/4de37e03aa4b4372843a7eb33fa41cad_6.jpg [width] => 306 [height] => 306 ) [thumbnail] => Array ( [url] => http://distillery.s3.amazonaws.com/media/2010/07/16/4de37e03aa4b4372843a7eb33fa41cad_5.jpg [width] => 150 [height] => 150 ) [standard_resolution] => Array ( [url] => http://distillery.s3.amazonaws.com/media/2010/07/16/4de37e03aa4b4372843a7eb33fa41cad_7.jpg [width] => 612 [height] => 612 ) ) [users_in_photo] => Array ( ) [caption] => [user_has_liked] => [id] => 3_3 [user] => Array ( [username] => kevin [website] => [profile_picture] => http://images.ak.instagram.com/profiles/profile_3_75sq_1325536697.jpg [full_name] => Kevin Systrom [bio] => [id] => 3 ) ) )


    Wobei für mich ja der Teil von Bedeutung ist:
    .. [images] => Array ( .. [standard_resolution] => Array ( http:// http://=> [url]http://distillery.s3.amazonaws.com/media/2010/07/16/4de37e03aa4b4372843a7eb33fa41cad_7.jpg .. ) ) ..[/code]
    Der eindeutig vorhanden ist.


    Mein Fehler, habe das [data] weggelassen. Klappt nun! Danke.


    Advertising has us chasing cars and clothes, working jobs we hate so we can buy shit we don’t need.
    – Tyler Durden


    Sobald Werbung im Spiel ist, bist du, die Nutzerin, der Nutzer, das Produkt.


  • Kleiner Tipp am Rande.
    Du kannst, wenn du dir Arrays ausgibst, den HTML Tag <pre> </pre> nutzen.
    Dazwischen dann den pre formated Text (zuvor formatierten Text) und du bekommst es schön eindeutig und eingrückt :)

    ik bin der vito c:

  • Ist mir bewusst aber benutze nen Online Parser deswegen brauche ich das gar nicht, der gibt es mir schön übersichtlich aus. :)


    Advertising has us chasing cars and clothes, working jobs we hate so we can buy shit we don’t need.
    – Tyler Durden


    Sobald Werbung im Spiel ist, bist du, die Nutzerin, der Nutzer, das Produkt.