JorisSpruyt / Social-Event-Wall

Show sponsors images, instagram and twitter pictures on the big screen
MIT License
8 stars 1 forks source link

Getting errors in browser console, images don't load. [screenshot attached] #3

Open idebashish opened 9 years ago

idebashish commented 9 years ago

When I run the script with just placing the Instagram client id then there seems to be an error which is reflected in the console. Tried running the site both locally and remotely but I get the same error in the console. Including a picture. Couldn't figure out whether I did some mistakes while configuring or the script has some issues. screen shot 2015-08-17 at 4 47 36 pm

JorisSpruyt commented 9 years ago

Hi Idebashish,

Can you make sure to provide all the relevant information? I don't see any screenshot here.

First off, does your server support php? Can you access the getInstagram.php file directly, if so what do you see there?

idebashish commented 9 years ago

yes, I ran with XAMPP so yes, it had PHP support locally. Also my hosting plan with GoDaddy has PHP. Yes, I can access getInstagram.php but I see "null".

JorisSpruyt commented 9 years ago

If you copy the url from getInstagram.php on line 8 and paste that in a browser, what is the result? I'm guessing you have a problem accessing the Instagram Api.

Edit: make sure to replace the variables

idebashish commented 9 years ago

{"pagination":{"next_max_tag_id":"971521527126882751","deprecation_warning":"next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead","next_max_id":"971521527126882751","next_min_id":"1052026414071217046","min_tag_id":"1052026414071217046","next_url":"https:\/\/api.instagram.com\/v1\/tags\/prinstaindia\/media\/recent?client_id=fe3b5dd80f1d4f979c266acd3e6de3a1\u0026max_tag_id=971521527126882751"},"meta":{"code":200},"data":[{"attribution":null,"tags":["prinstaindia","thank","\ud83c\udf77","\ud83c\udf89\ud83c\udf8a","\ud83c\udf70","printing","\ud83d\udc83\ud83c\udffd","\ud83c\udf7b","happiness"],"location":{"latitude":19.193111912,"longitude":72.837633295},"comments":{"count":0,"data":

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I get the response like the above..

JorisSpruyt commented 9 years ago

That means that either your server cannot access instagram or the internet. Or that there is a problem parsing the json data.

In the getInstagram.php file place the for each loop in comment (/\ on line 11 and **/ on line 28 after the echo)

And then paste the following on line 10, after the declaration of $obj

echo $obj; echo ('
encoded:
'); echo json_encode($json);

if you then surf to your url/getInstagram.php you should see the following; Array encoded:

If this doesn't work you have an issue with your server contacting the internet
idebashish commented 9 years ago

I get the below result after I made the changes: Array encoded: "{\"pagination\":{\"deprecation_warning\":\"next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead\"},\"meta\":{\"code\":200},\"data\":[]}"

But the images don't show up.

JorisSpruyt commented 9 years ago

Is that the complete response? It looks like you're not receiving any answers, there is no data. What hashtag are you using?