Skip to content

Instantly share code, notes, and snippets.

@bradwestfall
Last active November 20, 2022 14:40
Show Gist options
  • Save bradwestfall/f5a010e96fb0c4d18556 to your computer and use it in GitHub Desktop.
Save bradwestfall/f5a010e96fb0c4d18556 to your computer and use it in GitHub Desktop.

Revisions

  1. bradwestfall revised this gist Jan 27, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -58,12 +58,12 @@ feed.run();

    You provide:
    ```html
    <div class="instafeed"></div>
    <div id="instafeed"></div>
    ```

    And InstaFeed will create:
    ```html
    <div class="instafeed">
    <div id="instafeed">
    <a href="..."><img src="..."></a>
    <a href="..."><img src="..."></a>
    <a href="..."><img src="..."></a>
  2. bradwestfall revised this gist Jan 7, 2015. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,11 @@ Create a new "Client"

    Doing these steps should result in a `Client ID`

    Go to this URL in the browser `https://instagram.com/oauth/authorize/?client_id=[CLIENT_ID_HERE]&redirect_uri=http://localhost&response_type=token` and substitute your `Client ID`. If you get an error, chances are you didn't uncheck that box in the last step. You can always "edit" the client and uncheck the box to do this step over
    Go to this URL in the browser:

    `https://instagram.com/oauth/authorize/?client_id=[CLIENT_ID_HERE]&redirect_uri=[OAuth_Redirect_URI]&response_type=token`

    and substitute your `Client ID`/`OAuth_Redirect_URI`. If you get an error, chances are you didn't uncheck that box in the last step. You can always "edit" the client and uncheck the box to do this step over

    Going to the URL will reveal your `access_token`. You may need any combination of `client id`, `access token`, or `user id` depending on how you want to access data. Do not delete the "Client" you made at Instagram.

  3. bradwestfall revised this gist Jan 2, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Pull Instagram Images via JavaScript
    # Get Instagram Images via JavaScript

    ## Get API Info

  4. bradwestfall revised this gist Jan 1, 2015. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -41,13 +41,13 @@ feed.run();
    ### Search all of Instagram for a certain hash tag

    ```js
    var feed = new Instafeed({
    clientId: '[client_id]',
    get: 'tagged',
    tagName: 'newyears',
    resolution: 'low_resolution'
    });
    feed.run();
    var feed = new Instafeed({
    clientId: '[client_id]',
    get: 'tagged',
    tagName: 'newyears',
    resolution: 'low_resolution'
    });
    feed.run();
    ```

    ### The HTML
  5. bradwestfall revised this gist Jan 1, 2015. 1 changed file with 47 additions and 4 deletions.
    51 changes: 47 additions & 4 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -11,8 +11,8 @@ You will also need an `access token` which ends up being difficult to obtain. Lo
    Create a new "Client"
    - __Application Name__: Just enter "website"
    - __Description__: Enter whatever
    - __Website__: Enter your domain name. I don't think it has to exist already. But I know your requests aren't limmited to only this domain - at least as of now
    - OAuth_redirect_uri: Enter the same website URL
    - __Website__: Enter your domain name. I don't think it has to exist already. But I know your requests aren't limmited to only this domain - at least as of now.
    - __OAuth_redirect_uri__: Enter the same website URL
    - Uncheck the "Disable Implicite OAuth"

    Doing these steps should result in a `Client ID`
    @@ -21,9 +21,52 @@ Go to this URL in the browser `https://instagram.com/oauth/authorize/?client_id=

    Going to the URL will reveal your `access_token`. You may need any combination of `client id`, `access token`, or `user id` depending on how you want to access data. Do not delete the "Client" you made at Instagram.

    ##
    ## InstaFeed: http://instafeedjs.com/

    http://instafeedjs.com/
    ### Get a specific user, and filter on criteria (a specific hash tag in this case)

    ```js
    var feed = new Instafeed({
    get: 'user',
    userId: [user_id],
    accessToken: '[accessToken]',
    resolution: 'low_resolution',
    filter: function(image) {
    return image.tags.indexOf('somehashtag') >= 0;
    }
    });
    feed.run();
    ```

    ### Search all of Instagram for a certain hash tag

    ```js
    var feed = new Instafeed({
    clientId: '[client_id]',
    get: 'tagged',
    tagName: 'newyears',
    resolution: 'low_resolution'
    });
    feed.run();
    ```

    ### The HTML

    You provide:
    ```html
    <div class="instafeed"></div>
    ```

    And InstaFeed will create:
    ```html
    <div class="instafeed">
    <a href="..."><img src="..."></a>
    <a href="..."><img src="..."></a>
    <a href="..."><img src="..."></a>
    <a href="..."><img src="..."></a>
    </div>
    ```

    But this can very easily be changed in terms of what template InstaFeed will use


  6. bradwestfall created this gist Jan 1, 2015.
    29 changes: 29 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    # Pull Instagram Images via JavaScript

    ## Get API Info

    You will need the `user_id` from the user. This is difficult to discover at Instagram but easy from this site http://jelled.com/instagram/lookup-user-id

    > I used http://jelled.com/instagram/access-token for the next few steps
    You will also need an `access token` which ends up being difficult to obtain. Log into the account and go to their [Developer Page](http://instagram.com/developer).

    Create a new "Client"
    - __Application Name__: Just enter "website"
    - __Description__: Enter whatever
    - __Website__: Enter your domain name. I don't think it has to exist already. But I know your requests aren't limmited to only this domain - at least as of now
    - OAuth_redirect_uri: Enter the same website URL
    - Uncheck the "Disable Implicite OAuth"

    Doing these steps should result in a `Client ID`

    Go to this URL in the browser `https://instagram.com/oauth/authorize/?client_id=[CLIENT_ID_HERE]&redirect_uri=http://localhost&response_type=token` and substitute your `Client ID`. If you get an error, chances are you didn't uncheck that box in the last step. You can always "edit" the client and uncheck the box to do this step over

    Going to the URL will reveal your `access_token`. You may need any combination of `client id`, `access token`, or `user id` depending on how you want to access data. Do not delete the "Client" you made at Instagram.

    ##

    http://instafeedjs.com/