1function getInstagramImages(numPhotos, callback) { 2 if (window.Instafeed) { 3 var count = 0; 4 var feed = new Instafeed({ 5 get: "tagged", 6 tagName: "travellertours", 7 clientId: "02f7ff46df794d6caed9553e40be0970", 8 accessToken: "1445170882.ba4c844.dbeddae130c94926abc2c7d8c43d6433", 9 sortBy: "most-recent", 10 limit: numPhotos, 11 mock: true, 12 after: function() { 13 if (count < numPhotos) { 14 feed.next(); 15 } 16 }, 17 success: function(r) { 18 var data = r.data; 19 if (!!window.BLOCKED_INSTAGRAM_USERNAMES && !!window.jQuery) { 20 data = data.filter(function(item) { 21 return ( 22 jQuery.inArray( 23 item.user.username, 24 BLOCKED_INSTAGRAM_USERNAMES 25 ) === -1 26 ); 27 }); 28 } 29 if (!!window.BLOCKED_INSTAGRAM_UIDS && !!window.jQuery) { 30 data = data.filter(function(item) { 31 return jQuery.inArray(item.user.id, BLOCKED_INSTAGRAM_UIDS) === -1; 32 }); 33 } 34 if (!!window.HASHTAGS && !!window.jQuery) { 35 data = data.filter(function(item) { 36 return (function() { 37 var flag = true; 38 for ( 39 var index = 0, length = window.HASHTAGS.length; 40 index < length; 41 index += 1 42 ) { 43 if ( 44 item.tags.findIndex(function(hashtag) { 45 return hashtag === window.HASHTAGS[index]; 46 }) === -1 47 ) { 48 flag = false; 49 break; 50 } 51 } 52 return flag; 53 })(); 54 }); 55 } 56 57 count += data.length; 58 59 callback(data); 60 } 61 }); 62 feed.run(); 63 } 64} 65 66function formatDate(date) { 67 if (date === undefined) { 68 return ""; 69 } 70 var monthNames = [ 71 "January", 72 "February", 73 "March", 74 "April", 75 "May", 76 "June", 77 "July", 78 "August", 79 "September", 80 "October", 81 "November", 82 "December" 83 ]; 84 var day = String(date.getDate()); 85 if (day.length == 1) { 86 day = "0" + day; 87 } 88 var monthIndex = date.getMonth(); 89 var year = date.getFullYear(); 90 return monthNames[monthIndex] + " " + day + ", " + year; 91} 92 93var localCache = { 94 data: {}, 95 remove: function(url) { 96 delete localCache.data[url]; 97 }, 98 exist: function(url) { 99 return localCache.data.hasOwnProperty(url) && localCache.data[url] !== null; 100 }, 101 get: function(url) { 102 console.log("Getting in cache for url" + url); 103 return localCache.data[url]; 104 }, 105 set: function(url, cachedData, callback) { 106 localCache.remove(url); 107 localCache.data[url] = cachedData; 108 if ($.isFunction(callback)) callback(cachedData); 109 } 110}; 111 112Date.prototype.addDays = function(days) { 113 var dat = new Date(this.valueOf()); 114 dat.setDate(dat.getDate() + days); 115 return dat; 116};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.