@@ -87,13 +87,14 @@ The only thing you'll need to get going is a valid __client id__ from Instagram'
87
87
given the image data as an argument, and expects the function to return a boolean. See the example
88
88
below for more information.
89
89
90
- __ Example Filter:__
90
+ __ Example Filter (get username + tagged) :__
91
91
92
92
``` js
93
93
var feed = new Instafeed ({
94
+ get: ' user' ,
95
+ userId: USER_ID ,
94
96
filter : function (image ) {
95
- // only display images with at least 10 likes
96
- return image .likes .count >= 10 ;
97
+ return image .tags .indexOf (' TAG_NAME' ) >= 0 ;
97
98
}
98
99
});
99
100
feed .run ();
@@ -139,29 +140,24 @@ Under the hood, this uses the _pagination_ data from the API. Additionall, there
139
140
Together these options can be used to create a "Load More" button:
140
141
141
142
``` js
142
- function checkLoadMore () {
143
- // if there are no more results, disable the load more button
144
- if (! this .hasNext ()) {
145
- loadButton .setAttribute (' disabled' , ' disabled' );
146
- }
147
- };
143
+ // grab out load more button
144
+ var loadButton = document .getElementById (' load-more' ),
145
+
146
+ feed = new Instafeed ({
147
+ // every time we load more, run this function
148
+ after : function () {
149
+ // disable button if no more results to load
150
+ if (! this .hasNext ()) {
151
+ loadButton .setAttribute (' disabled' , ' disabled' );
152
+ }
153
+ },
154
+ });
148
155
149
- function handleLoadClick () {
150
- // load more!
156
+ // bind the load more button
157
+ loadButton . addEventListener ( ' click ' , function () {
151
158
feed .next ();
152
- };
153
-
154
- // create our Instafeed instance
155
- var feed = new Instafeed ({
156
- success: checkLoadMore
157
159
});
158
160
159
- // grab out load more button
160
- var loadButton = document .getElementById (' load-more' );
161
-
162
- // bind out click event
163
- loadButton .addEventListener (' click' , handleLoadClick);
164
-
165
161
// run our feed!
166
162
feed .run ();
167
163
```
0 commit comments