-
Notifications
You must be signed in to change notification settings - Fork 858
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d19342
commit bc3c109
Showing
6 changed files
with
80 additions
and
7 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Instafeed.js | ||
|
||
[![Build Status](https://travis-ci.com/stevenschobert/instafeed.js.svg?branch=master)](https://travis-ci.com/stevenschobert/instafeed.js) | ||
|
||
Instafeed.js is a simple way to display your Instagram photos on your website. | ||
|
||
We're in the process of launching Instafeed.js v2, powered by the new [Instagram Basic Display API](https://developers.facebook.com/docs/instagram-basic-display-api/). Guides and documentation are being created and will be added to the [project's wiki](https://github.com/stevenschobert/instafeed.js/wiki). | ||
|
||
See the [v2 migration guide](v2-migration-guide.md) for help on updating from v1, or a [basic demonstration with code examples](https://codepen.io/companionstudio/pen/rNVPGOz). | ||
|
||
For the now-non-functional v1.x library, please [see the Legacy API branch](https://github.com/stevenschobert/instafeed.js/tree/legacy-api). | ||
|
||
## Installation | ||
|
||
Setting up Instafeed is pretty straight-forward - there are 3 main steps. | ||
|
||
1. Create a Facebook app linked to Instagram, and add yourself as a test user. See [Managing User Tokens](https://github.com/stevenschobert/instafeed.js/wiki/Managing-Access-Tokens). | ||
2. Create an access token and provide it to an [Instagram Token service](https://github.com/companionstudio/instagram-token-agent) | ||
3. Add the instafeed.js script to your web page and provide some simple options. See [Basic Usage](https://github.com/stevenschobert/instafeed.js/wiki/Basic-Usage) | ||
|
||
```html | ||
<script type="text/javascript" src="path/to/instafeed.min.js"></script> | ||
``` | ||
|
||
> Note: Instafeed.js is also compatible with require.js and commonJS exports | ||
## Basic Usage | ||
|
||
```html | ||
<div id="instafeed"></div> | ||
|
||
<script type="text/javascript"> | ||
var feed = new Instafeed({ | ||
accessToken: 'your-token' | ||
}); | ||
feed.run(); | ||
</script> | ||
``` | ||
|
||
Instafeed will automatically look for a `<div id="instafeed"></div>` and fill it with linked thumbnails. Of course, you can easily change this behavior using [standard options](#standard-options). Also check out the [advanced options](#advanced-options) for some advanced ways of customizing __Instafeed.js__. | ||
|
||
## Requirements | ||
|
||
* A Facebook developer account, and an Instagram account with some media posted to it. | ||
* A Facebook app linked to your Instagram account, and a token generated through that app. | ||
* A service to keep your access token fresh | ||
|
||
## Options | ||
|
||
Here are some of the most commonly used options: | ||
|
||
| Key | Default Value | Valid types | Description | | ||
|---|---|---|---| | ||
| `accessToken` | `null` | String, Function | **Required.** The Instagram access token, either as a string, or a function which returns a string | | ||
| `debug` | `false` | Boolean | Set to `true` to display debugging information | | ||
| `filter` | `null` | Function | A function used to exclude images from your results. The function will be given the image data as an argument, and expects the function to return a boolean. | | ||
| `limit` | `null` | Number | Display a maximum of this many posts | | ||
| `sort` | `null` | Function | A custom function to sort the media, rather than the default 'most recent' sorting| | ||
| `target` | `'instafeed'` | String, DOM Element | Either the ID or the DOM element itself where you want to add the images. | | ||
| `template` | `'<a href="{{link}}"><img title="{{caption}}" src="{{image}}" /></a>'` | String | A mustache template used to produce HTML for the document. | | ||
| `transform` | `null` | Function | A function used to transform the image data before it is rendered. | | ||
|
||
See [Options](https://github.com/stevenschobert/instafeed.js/wiki/Options-Reference) in the wiki for the complete reference. | ||
|
||
## Templating | ||
|
||
The easiest way to control the way Instafeed.js looks on your website is to use the __template__ option. You can write your own HTML markup and it will be used for every image that Instafeed.js fetches. See [Templating](https://github.com/stevenschobert/instafeed.js/wiki/Templating). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters