Skip to content

Instantly share code, notes, and snippets.

@halfempty
Created June 7, 2014 00:52
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halfempty/d5dd9b636b69ffa2e5c5 to your computer and use it in GitHub Desktop.
Save halfempty/d5dd9b636b69ffa2e5c5 to your computer and use it in GitHub Desktop.
Instafeed example for @jerb0x
var feed = new Instafeed({
get: 'user',
userId: 636337139,
accessToken: '262351.467ede5.176ab1984b1d47e6b8dea518109d7a5e',
link: 'true',
clientId: '80aeda87e8c44281b83ce6f542a30933',
limit: '1',
sortBy: 'most-recent',
resolution: 'standard_resolution',
links: false,
template: '<h3>{{model.created_time}} {{model.tagsFormatted}}</h3><img src="{{image}}" />',
filter: function(image) {
var date = new Date(image.created_time*1000);
m = date.getMonth();
d = date.getDate();
y = date.getFullYear();
var month_names = new Array ( );
month_names[month_names.length] = "Jan";
month_names[month_names.length] = "Feb";
month_names[month_names.length] = "Mar";
month_names[month_names.length] = "Apr";
month_names[month_names.length] = "May";
month_names[month_names.length] = "Jun";
month_names[month_names.length] = "Jul";
month_names[month_names.length] = "Aug";
month_names[month_names.length] = "Sep";
month_names[month_names.length] = "Oct";
month_names[month_names.length] = "Nov";
month_names[month_names.length] = "Dec";
var thetime = month_names[m] + ' ' + d + ' ' + y;
image.created_time = thetime;
return true;
}
});
feed.run();
@mikkellindblom
Copy link

Thanks man!

@chithract
Copy link

Thanks... Great help!!

@jameshiggins
Copy link

Thanks!

Copy link

ghost commented Aug 27, 2016

Thank you!

@mnmglobalgit
Copy link

awesome thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment