Skip to content

Issue with the geogram program #3

@ACodeJaydian

Description

@ACodeJaydian

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


<title>geogram</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script src="script.js"></script> Submit

'; } } ?>

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);
}
});
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions