javascript - How to obtain instagram pictures from a place consuming instagram API? -
i gave instafeed.js. works right away, followed first docs , got 20 images sample displaying @ web page.
however need obtain pictures place (city, in case). working twitter api used woeid
wanted place. here seems quite similar.
i read instagram docs:
distance default 1000m (distance=1000), max distance 5000. facebook_places_id returns location mapped off of facebook places id. if used, foursquare id , lat, lng not required. foursquare_id returns location mapped off of foursquare v1 api location id. if used, not required use lat , lng. note method deprecated; should use new foursquare ids v2 of api. lat latitude of center search coordinate. if used, lng required. lng longitude of center search coordinate. if used, lat required. foursquare_v2_id returns location mapped off of foursquare v2 api location id. if used, not required use lat , lng.
but hell can obtain such id's city. let's want pictures tagged dinner @ puebla, mexico. should do.
i used nice site id coordinates: http://maihamakyo.org/etc/locastagram/index.php
tried java script code then:
var feed = new instafeed({ get: 'tagged', location: '46016173', tagname: 'cleu', clientid: '***' }) feed.run();
but got not expected result.
as of version 1.3, can add filter function instafeed.js, exclude images results.
so should able set get: "location"
, , locationid
, , filter out images don't contain tag you're looking for:
var feed = new instafeed({ get: 'location', locationid: loc_id, // other settings omitted example filter: function(image) { return image.tags.indexof('tag_name') >= 0; } }); feed.run();
update
the image
parameter gets passed filter
function image data straight instagram's api. can filter on criteria want. make sure function returns true
or false
:
filter: function(image) { if (image.tags.indexof('tag_name') >= 0 && image.filter === "normal") { return true; } return false; }
to idea of properties image
object has, check this thread on github.
Comments
Post a Comment