jelled / geogram

A simple application to lookup Instagram photos by location.
MIT License
90 stars 108 forks source link

Issue with the geogram program #3

Open ACodeJaydian opened 7 years ago

ACodeJaydian commented 7 years ago

Hello Ben -

First of all, thanks for putting up the simple and to the point video. i am currently learning how to use APIs and this is a great start. SO Thank you for your excellent work.

Issue: There a a few errors (may be few changes that i need to make) in the geogram.php file

  1. The AJAX calls fails and the library its looking for does not exist

  2. The OAuthentication error keeps popping up from the instagram website. NOTE: I did registered on the developer site of instagram and generated a clientID. still does not work

  3. When i run the GeoGram.php program it gives few trailing characters on the web page which are basically from the program i.e. It gives a text box, submit button then after that there is trailing "'"}}. ---> dont understand why this is happening

  4. Please note: (Using MAC OSx El Capitan) a) I have installed the recent stable version of TomCat 8.0.36 (I know 8.5 is also available) b) I have installed php 7.0 version on my mac c) I have ran other php programs on the localhost and they work fine

I am posting the code here, please take a look and advice. It will be a great help

GeoGram.php


<!DOCTYPE html>

<?php if (!empty($_GET['location'])) { /**

geogram


'; } } ?>

Script Program $(document).ready(function () { setInterval(function () { itsAjaxTime(); }, 5000); itsAjaxTime(); });

function itsAjaxTime() { var url = $('#results').data('url'); $.getJSON(url + '&callback=?', function (data) { addNewImages(data); }); }

function addNewImages(data) { $.each(data.data, function (index, image) { if ($('#' + image.id).length == 0) { var img = $('<img ' + 'id="' + image.id + '" src="' + image.images.low_resolution.url + '" alt=""/>
'); img.hide().prependTo('#results').fadeIn(2000); } }); }

ACodeJaydian commented 7 years ago

<!DOCTYPE html>

<?php if (!empty($_GET['location'])) { /**

geogram


'; } } ?>