Skip to content

Commit ca5aa5a

Browse files
update readme.
1 parent 663d78d commit ca5aa5a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,23 @@ The only thing you'll need to get going is a valid __client id__ from Instagram'
8181
- `success` (function) - A callback function called when Instagram returns valid data. (argument -> json object)
8282
- `error` (function) - A callback function called when there is an error fetching images. (argument -> string message)
8383
- `mock` (bool) - Set to true fetch data without inserting images into DOM. Use with __success__ callback.
84+
- `filter` (function) - A function used to exclude images from your results. The function will be
85+
given the image data as an argument, and expects the function to return a boolean. See the example
86+
below for more information.
87+
88+
__Example Filter:__
89+
90+
```js
91+
var feed = new Instafeed({
92+
filter: function(image) {
93+
// only display images with at least 10 likes
94+
return image.likes.count >= 10;
95+
}
96+
});
97+
feed.run();
98+
```
99+
100+
To see a full list of properties that `image` has, see [issue #21](https://github.com/stevenschobert/instafeed.js/issues/21).
84101

85102
## Templating
86103

@@ -151,6 +168,7 @@ This will install all the necessary test tools for testing. There is also a Make
151168
__1.3.0__
152169

153170
- Image URLs are now protocol-relative by default. Use the new `useHttp` option to disable.
171+
- Add the ability to filter out images using the `filter` option.
154172

155173
__1.2.1__
156174

0 commit comments

Comments
 (0)