Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Associating facebookarchive/python-instagram Functions API with CWebsiteMS #259

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
68fa152
Init Image using object_from_dictionary for
shayne Feb 24, 2011
2ea1ed4
adding realtime support
Feb 17, 2011
83b9d15
updating accepted parameters for subscriptions
Feb 24, 2011
2d41991
Bumping version number
Feb 24, 2011
1da5ad4
Added method exchange_user_id_for_access_token
shayne Feb 28, 2011
5329ddf
Adding user_liked_media endpoint
Jun 2, 2011
73bcdf1
handle non-ID'd locations
Jun 2, 2011
2ce61e5
Fixing user follows / followed-by endpoints
Jun 20, 2011
0745e51
Specified basic scope explicitly when authenticating because API give…
sandinmyjoints Sep 5, 2011
caa3bba
Updated README.md to say media_popular and standard_resolution.
sandinmyjoints Sep 5, 2011
53daf35
Updated sample_app docs to specify that oauth_callback must be part o…
sandinmyjoints Sep 5, 2011
63d826d
added Caption field to Media model objects
prehensile Oct 16, 2011
c3e48c3
Merge pull request #7 from sandinmyjoints/master
Feb 15, 2012
8f24b8b
Merge pull request #9 from prehensile/master
Feb 15, 2012
55c0950
return raw json responses instead of media objects
Feb 16, 2012
faaad4c
return_json instead of media obeject
Feb 16, 2012
9e63cf5
return_json api_responses, not media objects
Feb 16, 2012
fef1e63
Disable SSL validation.
akumria Feb 16, 2012
c80ef51
Not all Locations have latitude / longitude.
akumria Feb 16, 2012
bd9fd8a
As well as returning the access_token, return who it is associated to
akumria Feb 20, 2012
4867b59
Relationship changes are a POSTed.
akumria Feb 20, 2012
8861a94
Merge pull request #15 from akumria/fixup-oauth-return-user
Feb 24, 2012
b5675a1
Merge pull request #14 from akumria/fixup-relationships
Feb 24, 2012
00e1fef
Merge pull request #13 from akumria/fixup-media-popular
Feb 24, 2012
ba703ed
Merge pull request #11 from shreyansb/master
Feb 24, 2012
94c3230
Minor spacing fix
Feb 24, 2012
c95107c
Updating model to reflect new Relationship
etchalon Nov 22, 2011
9be6079
Merge pull request #12 from akumria/fixup-https
Feb 24, 2012
7cb5ca1
Updated the Location model to pass point in the kwargs as opposed the…
Jul 2, 2011
958f632
Added new json fixuture
mgunneras Feb 26, 2011
d0bdf26
Added list of Users to Media.likes if available
mgunneras Feb 26, 2011
e076fb4
Added caption class
mgunneras Feb 26, 2011
086d32d
Fixed bug where str representation of Comment returned None
mgunneras Feb 26, 2011
c84d764
Added Caption to Media model
mgunneras Feb 26, 2011
4832523
Added method to fetch Media based on geography_id
mgunneras Feb 26, 2011
a1e8c03
Whitespace cleanup tabs are now spaces.
mgunneras Feb 26, 2011
ed43974
Fix bug where Point didn't get added to Location
mgunneras Feb 28, 2011
13c9df3
Added filter property to Media model
mgunneras Feb 28, 2011
557678c
Fixed bug in geographies url endpoint
mgunneras Feb 28, 2011
ed0bccf
Added fixture for geography query
mgunneras Feb 28, 2011
38b0e21
fixed models
mgunneras Apr 10, 2011
7931110
Bugfix. check key not attribute of dict
mgunneras Apr 11, 2011
9e62146
Handle if filter is missing
Feb 24, 2012
2f8beda
Making the mock http class compatible with the kwarg passed in
Feb 24, 2012
8e8ccbf
Version bump and README update
Feb 24, 2012
142c64e
Updating readme with pip instructions
Feb 24, 2012
38eb254
Default args should not be mutable
michaelhelmick Feb 24, 2012
9559336
Merge pull request #16 from michaelhelmick/master
Feb 24, 2012
d37641d
Fix #15
michaelhelmick Feb 24, 2012
c3fd4f5
Fix #15
michaelhelmick Feb 24, 2012
d8a1d48
Add an 'empty' type explicitly
Feb 25, 2012
bcb0f71
Version bump
Feb 25, 2012
cb70746
Adding tags; fixes #6
Feb 25, 2012
67a60c6
Another version bump
Feb 25, 2012
9132cef
Readme updates
Feb 25, 2012
6b43209
Make it easier to identify various models with a __unicode__ method.
akumria Feb 28, 2012
17cb064
Switch __str__ to __unicode__
akumria Feb 28, 2012
6c2d83b
Prefix this with what kind of object it is.
akumria Feb 28, 2012
c4a4415
Remove duplicated settings of the caption.
akumria Feb 28, 2012
e079e1a
There are no users of the Caption model, remove it.
akumria Feb 28, 2012
727939e
Explicitly construct the appropriate object.
akumria Feb 28, 2012
9b8d2af
Convert the Tags dictionary into Tags objects too.
akumria Feb 28, 2012
2c5f308
Merge pull request #21 from akumria/fixup-add-tags-to-media
Feb 28, 2012
6349372
Merge pull request #20 from akumria/fixup-models
Feb 28, 2012
ba62e57
Merge pull request #22 from akumria/fixup-remove-caption
Feb 28, 2012
51c2064
Merge branch 'master' of git://github.com/Instagram/python-instagram
michaelhelmick Feb 29, 2012
0deeabb
Datetime to Timestamp helper
michaelhelmick Feb 29, 2012
911e4c9
PEP8 Cleanup
michaelhelmick Feb 29, 2012
2a73f90
Merge pull request #24 from michaelhelmick/pep8_cleanup
Mar 2, 2012
4cead55
Merge pull request #23 from michaelhelmick/datetime_to_timestamp
Mar 2, 2012
25780e1
Updating fixture; temp removing test that doesn't match what we do in…
Mar 2, 2012
7b7e3f4
version bump
Mar 2, 2012
7ce1f49
Changed message to error_message, as that's what the API returns to m…
pamelafox Apr 9, 2012
53e1a7f
Adding more information to the README. The API is written in a way su…
pamelafox Apr 11, 2012
212ea92
Merge pull request #26 from pamelafox/patch-2
May 27, 2012
6906a95
Merge pull request #25 from pamelafox/patch-1
May 27, 2012
0d1726a
Added user_relationship method, more verbose simplejson import, excep…
michaelhelmick May 28, 2012
884aa80
0.8.0, Bumping the minor because we *added a method*
michaelhelmick May 28, 2012
0e48d18
Add user_relationship to README
michaelhelmick May 29, 2012
417f5b2
Merge remote-tracking branch 'michaelhelmick/relationship_status'
May 29, 2012
95dc1c5
Central json import logic
May 29, 2012
0028906
Fixed bug in sample_app.py. The access_token needs to be unpacked fro…
tonyxiao Jul 8, 2012
b8e88f1
Handle OAuthRateLimitException from Nginx
benneic Jul 31, 2012
07c4d56
Handling any non meta response
benneic Jul 31, 2012
f81532a
Fix comparison type bug
benneic Jul 31, 2012
aefb118
Add pagination_format parameter to api methods.
Aug 7, 2012
71e7c05
Added line break
techguydave Nov 14, 2012
f2f6313
Update location_search method to accept new foursquare_v2_id parameter
dvonlehman May 16, 2013
e95c7bd
Fixed example code in README.md
kenkam Jun 2, 2013
d65f26c
use json_import instead of simplejson
isnowfy Jul 22, 2013
29290ba
add with_next_url implement to easy paginator
isnowfy Aug 18, 2013
2f4247b
Import simplejson with json_import
holagvk Sep 14, 2013
74ef87f
Update README.md
dangayle Sep 17, 2013
9d5b63d
Merge pull request #52 from dangayle/master
albertotretti Dec 17, 2013
ea0646c
Merge pull request #40 from synth3tk/patch-1
albertotretti Dec 17, 2013
45b3094
Merge pull request #47 from kenkam/master
albertotretti Dec 17, 2013
5bfd9d6
Merge pull request #31 from tonyxiao/patch-1
albertotretti Dec 17, 2013
b6f0fed
Merge pull request #51 from gvkalra/patch-1
albertotretti Dec 17, 2013
a1563a1
Add syntax highlighting for Python examples
Jan 21, 2014
6bc555b
Set version to our own.
Feb 3, 2014
445f6ed
Media now supports video, has a 'type' field and additional url acces…
phniix Apr 1, 2014
3fe546d
README update with CLA and new License and version 1 bump
heatonjb Apr 7, 2014
4d1e2c6
Merge branch 'master' of github.com:isnowfy/python-instagram into isn…
heatonjb Apr 22, 2014
d5eae33
Merge pull request #61 from philsturgeon/patch-1
heatonjb Apr 23, 2014
eb0cd3b
Merge branch 'video_support' of github.com:jjshabs/python-instagram i…
heatonjb Apr 23, 2014
28d89f6
added x-ratelimt support to client obj
heatonjb Apr 24, 2014
5414f8d
Merge branch 'master' of github.com:Instagram/python-instagram
heatonjb Apr 24, 2014
32704a3
sample app update
heatonjb Apr 24, 2014
5d8cd6a
Merge branch 'master' of github.com:dvonlehman/python-instagram into …
heatonjb Apr 24, 2014
c8f47b9
Merge branch 'master' of github.com:beichhor/python-instagram into be…
heatonjb Apr 24, 2014
07b4032
Adding an optional status_code to InstagramClientError
johnboiles May 2, 2014
c7656b7
updated sample to use new media methods
heatonjb May 9, 2014
5e8a0e2
Merge branch 'master' of github.com:johnboiles/python-instagram into …
heatonjb May 9, 2014
d51700b
Merge branch 'johnboiles-master' propagates API response codes
heatonjb May 9, 2014
9b0f9f1
Update README.md Sample app section
j-e-d May 12, 2014
8c2f06b
Update README.md Sample app to include Redis
j-e-d May 12, 2014
136be37
Merge pull request #69 from j-e-d/patch-1
heatonjb May 15, 2014
51a8ed4
Merge branch 'pagination-format' of github.com:henninge/python-instag…
heatonjb May 15, 2014
efe46fc
Merge branch 'henninge-pagination-format'
heatonjb May 15, 2014
b5e136b
Merge branch 'master' of github.com:Instagram/python-instagram
heatonjb May 15, 2014
3adbb5d
add support for new http status code for ratelimit exceeded
heatonjb May 22, 2014
d58f452
Adding the Travis configuration file.
yssk22 Jun 2, 2014
16d1bc5
Support the signed header.
yssk22 Jun 3, 2014
a43b176
Merge branch 'travis-ci' of github.com:yssk22/python-instagram into y…
heatonjb Jun 3, 2014
caca3d1
Merge branch 'yssk22-travis-ci'
heatonjb Jun 3, 2014
de5ec37
changed to support secured requests
heatonjb Jun 3, 2014
d090bfd
Merge branch 'yssk22-signed-post'
heatonjb Jun 3, 2014
2d480bf
updated sample app to add like and unlike
heatonjb Jun 3, 2014
dd796e7
version increment
heatonjb Jun 3, 2014
bf877e8
supporting /media/shortcode url
Jun 3, 2014
de29177
Merge branch 'lcarvalho-master'
heatonjb Jun 9, 2014
1b9f7a4
added media shortcode support
heatonjb Jun 9, 2014
3792a73
Prevent using Python built-in function.
yoloseem Jun 12, 2014
cef786f
cast location.id to string
Jul 2, 2014
797c0b5
version bump
Jul 2, 2014
dd692da
Add option for max_pages=None.
johncadengo Jul 7, 2014
7f607ef
Feature - User Follows
cmlh Jul 15, 2014
239104c
Create valid path if no api.format specified
Jul 21, 2014
64641a8
Return the value for error code, type and message when no meta in res…
thelinuxkid Jul 28, 2014
c5fb9a9
subscription POST and DELETE require signed header
thelinuxkid Jul 31, 2014
db9cafa
Merge branch 'johncadengo-max-pages-none'
Jul 31, 2014
190bd95
Merge pull request #81 from yoloseem/patch-1
heatonjb Aug 5, 2014
d932162
Merge pull request #88 from cmlh/user_follows
heatonjb Aug 5, 2014
d5730dc
Merge pull request #89 from tomdottom/master
heatonjb Aug 5, 2014
75fe793
Merge pull request #92 from thelinuxkid/master
heatonjb Aug 5, 2014
ea61194
adding egg files
Aug 5, 2014
21ba5cb
version increase for 1.1.3 release;
Aug 5, 2014
3cb4305
tag_recent_media param is max_tag_id not max_id.
danielroseman Aug 12, 2014
6637220
Feature - Travis CI
cmlh Aug 27, 2014
4e9373c
Feature - Travis-CI Badge
cmlh Aug 27, 2014
3b75863
Mention handling errors by status codes in README
Sep 7, 2014
74dd7aa
first cut of python 3 support
Sep 25, 2014
2ba69fe
updated version to 1.1.4
Sep 25, 2014
f255a6d
updated readme
Sep 25, 2014
622fbec
removed comments
Sep 25, 2014
5b2849a
updated package requirements
Sep 25, 2014
01d9ae0
fixed Python 3 bug with disable certificate validation in httplib2
Sep 26, 2014
89f82ba
Merge branch 'dev'
Sep 26, 2014
16412bd
fixed bug
Sep 26, 2014
53faab3
Merge pull request #94 from danielroseman/recent_tags
heatonjb Oct 20, 2014
2b40f2a
Version bump
Oct 20, 2014
5018a9e
Merge branch 'travis-ci' of github.com:cmlh/python-instagram into cml…
Oct 20, 2014
e8d4c0f
changed travis url
Oct 20, 2014
c63d64e
Merge branch 'cmlh-travis-ci'
Oct 20, 2014
435f7b7
updated url to travis
Oct 20, 2014
7194301
Merge pull request #103 from jkdf2/master
heatonjb Oct 20, 2014
dee95d8
Merge branch 'master' of github.com:seajosh/python-instagram into sea…
Oct 20, 2014
82e65c7
python3 compat changes
Oct 23, 2014
8ddb0d6
Merge branch 'seajosh-master'
Oct 23, 2014
3e5ba60
Python 3 Compatibility
Oct 23, 2014
9d0f673
removed wsgiref==0.1.2 since it's a standard library python 2.5+
seajosh Nov 10, 2014
4712fac
changed content.decode() to content since it's previously decoded
seajosh Nov 10, 2014
fe86645
Merge pull request #109 from seajosh/master
heatonjb Nov 19, 2014
a9b78f7
added python 3 to Travis CI
seajosh Nov 19, 2014
e619099
#112 - travis.yml to be removed
seajosh Nov 19, 2014
31f5129
Merge pull request #113 from seajosh/master
heatonjb Nov 20, 2014
e885e7d
version increment
Nov 27, 2014
b48f6c2
removed extra whitespaces
vipul-sharma20 Jan 4, 2015
74261cb
Make registered subscription callbacks tied to the reactor object.
Jan 23, 2015
87dc812
fix _encode_multipart bug
gusibi Feb 15, 2015
a0c42e8
Added users_in_photo in Media
jimmyho Feb 22, 2015
d1784e1
Added users_in_photo in Media
jimmyho Feb 22, 2015
17c38f6
guard against users_in_photo being none
jimmyho Feb 22, 2015
83fe7f4
guard against users_in_photo being none
jimmyho Feb 22, 2015
79c41e1
update to support signed requests
Mar 17, 2015
8c80d84
Update README.md
davidawad Mar 24, 2015
8d11161
Return empty array for media.tags if tags do not exist instead of Att…
hassanmian Apr 2, 2015
bf59759
Merge pull request #1 from hassanmian/tags-empty-array
hassanmian Apr 2, 2015
3301d85
code highlighting for the pip command.
davidawad Apr 13, 2015
9ea533e
version bump to suport signed requests
Apr 15, 2015
d46e0eb
Fixes all tests failing because of `None` secret passed to `hmac.new`…
dtran320 Apr 23, 2015
8243ff7
Merge pull request #150 from Crowdbooster/hotfix/signed_request_no_cl…
heatonjb Apr 27, 2015
b9b1eb5
Merge pull request #141 from hassanmian/master
heatonjb Apr 27, 2015
8779a56
Merge pull request #122 from vipul-sharma20/my_branch
heatonjb Apr 27, 2015
cd9839e
Merge pull request #130 from zongxiao/master
heatonjb Apr 27, 2015
580e55f
Addresses #127: Add an `exclude_format` parameter to `bind_method` to…
dtran320 Mar 4, 2015
4230ca0
Added extra parameters (min_id, max_timestamp and min_timestamp) that…
nizam-sayeed May 29, 2015
ad777a9
Merge pull request #140 from DavidAwad/patch-1
heatonjb Jun 18, 2015
508a5e9
Merge pull request #144 from DavidAwad/patch-2
heatonjb Jun 18, 2015
1900740
Merge branch 'master' of https://github.com/Crowdbooster/python-insta…
Jun 18, 2015
15ec66b
Merge branch 'Crowdbooster-master'
Jun 18, 2015
a5b3f8c
Merge branch 'master' of https://github.com/nomadjourney/python-insta…
Jun 18, 2015
6644c23
Merge branch 'nomadjourney-master'
Jun 18, 2015
70811ec
Merge branch 'master' of https://github.com/jimmyho/python-instagram …
Jun 18, 2015
705bc2d
Merge branch 'jimmyho-master'
Jun 18, 2015
7fe07db
Merge pull request #125 from luk/ft-local-reactor-callbacks
heatonjb Jun 18, 2015
0312f8f
fixed nit in readme
Jun 18, 2015
44dce0d
Add exhaustive pagination example to README
tedmiston Jul 17, 2015
e5f7d58
Merge pull request #167 from tedmiston/exhaustive-pagination-example
heatonjb Jul 22, 2015
898111d
fix
Jul 22, 2015
dfeebe9
version bump
Jul 22, 2015
6522cff
Updated readme for archiving
Mar 23, 2016
da51708
Remove whitehat information
JoelMarcey Jan 3, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
install:
- "pip install ."
script: "python tests.py"

30 changes: 30 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BSD License

For python-instagram software

Copyright (c) 2014, Facebook, Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name Facebook nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
296 changes: 276 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,300 @@
- - -

**_This project is not actively maintained. Proceed at your own risk!_**

- - -

[![Build Status](https://api.travis-ci.org/Instagram/python-instagram.svg)](https://travis-ci.org/Instagram/python-instagram)

python-instagram
======
A Python client for the Instagram REST and Search APIs
A Python 2/3 client for the Instagram REST and Search APIs

Installation
-----
pip install instagram

```
pip install python-instagram
```
Requires
-----
* httplib2
* simplejson
* six


Instagram REST and Search APIs
------------------------------
Our [developer site](http://instagram.com/developer) documents all the Instagram REST and Search APIs.


Follow @instagramapi on Twitter
Blog
----------------------------
You can [follow @instagramapi on Twitter](http://twitter.com/#!/instagramapi) for announcements,
updates, and news about the Instagram gem.
The [Developer Blog] features news and important announcements about the Instagram Platform. You will also find tutorials and best practices to help you build great platform integrations. Make sure to subscribe to the RSS feed not to miss out on new posts: [http://developers.instagram.com](http://developers.instagram.com).

Obtaining an access token

Community
----------------------
The [Stack Overflow community](http://stackoverflow.com/questions/tagged/instagram/) is a great place to ask API related questions or if you need help with your code. Make sure to tag your questions with the Instagram tag to get fast answers from other fellow developers and members of the Instagram team.


Authentication
-----
You can use the provided get_access_token.py script to obtain an access token for yourself.
It will prompt you for your app's Client ID, Client Secret, and Redirect URI,
and walk you through instructions for getting your own access token for your app.

Usage
Instagram API uses the OAuth2 protocol for authentication, but not all functionality requires authentication.
See the docs for more information: http://instagram.com/developer/authentication/

### Obtaining an access token

If you're using a method that requires authentication and need an access token, you can use the provided get_access_token.py script to obtain an access token for yourself.
It will prompt you for your app's Client ID, Client Secret, and Redirect URI, and walk you through instructions for getting your own access token for your app.

### Authenticating a user

The provided sample app shows a simple OAuth flow for authenticating a user and getting an access token for them.

### Using an access token

Once you have an access token (whether via the script or from the user flow), you can pass that token into the InstagramAPI constructor:

``` python
from instagram.client import InstagramAPI

access_token = "YOUR_ACCESS_TOKEN"
client_secret = "YOUR_CLIENT_SECRET"
api = InstagramAPI(access_token=access_token, client_secret=client_secret)
recent_media, next_ = api.user_recent_media(user_id="userid", count=10)
for media in recent_media:
print media.caption.text
```

### Making unauthenticated requests

For methods that don't require authentication, you can just pass your client ID and optionally client secret into the InstagramAPI
constructor:

``` python
api = InstagramAPI(client_id='YOUR_CLIENT_ID', client_secret='YOUR_CLIENT_SECRET')
popular_media = api.media_popular(count=20)
for media in popular_media:
print media.images['standard_resolution'].url
```

Real-time Subscriptions:
-----

See the docs for more on real-time subscriptions: http://instagr.am/developer/realtime/

You can use the API to subscribe to users, tags, locations, or geographies:

``` python
# Subscribe to updates for all users authenticated to your app
api.create_subscription(object='user', aspect='media', callback_url='http://mydomain.com/hook/instagram')

# Subscribe to all media tagged with 'fox'
api.create_subscription(object='tag', object_id='fox', aspect='media', callback_url='http://mydomain.com/hook/instagram')

# Subscribe to all media in a given location
api.create_subscription(object='location', object_id='1257285', aspect='media', callback_url='http://mydomain.com/hook/instagram')

# Subscribe to all media in a geographic area
api.create_subscription(object='geography', lat=35.657872, lng=139.70232, radius=1000, aspect='media', callback_url='http://mydomain.com/hook/instagram')
```

Along with that, you would typically register subscription "reactors" for processing the different subscription types:

``` python
# React to user type updates
reactor = subscriptions.SubscriptionsReactor()
reactor.register_callback(subscriptions.SubscriptionType.USER, process_user_update)
```

See the provided sample app for an example of making a subscription, reacting to it, an processing the updates.

You can also use the API to list and delete subscriptions:

``` python
api.list_subscriptions()
api.delete_subscriptions(id=342342)
```


Data Retrieval:
-----
from instagram.client import InstagramAPI

access_token = "..."
api = InstagramAPI(access_token=access_token)
popular_media = api.popular_media(count=20)
for media in popular_media:
print media.images['high_resolution'].url
See the endpoints docs for more on these methods: http://instagr.am/developer/endpoints/

The methods with a * return two values, where the second is a pagination parameter. Here's an example of retrieving recent media:

``` python
recent_media, next_ = api.user_recent_media()
photos = []
for media in recent_media:
photos.append('<img src="%s"/>' % media.images['thumbnail'].url)
```

And an example of exhaustively pursuing a paginated endpoint:

``` python
follows, next_ = api.user_follows()
while next_:
more_follows, next_ = api.user_follows(with_next_url=next_)
follows.extend(more_follows)
```

Users: http://instagr.am/developer/endpoints/users/

``` python
api.user(user_id)
api.user_media_feed()*
api.user_liked_media()*
api.user_recent_media(user_id, count, max_id)*
api.user_search(q, count, lat, lng, min_timestamp, max_timestamp)
```

Relationships: http://instagr.am/developer/endpoints/relationships/

``` python
api.user_incoming_requests()
api.user_follows(user_id)*
api.user_followed_by(user_id)*
api.follow_user(user_id)
api.unfollow_user(user_id)
api.block_user(user_id)
api.unblock_user(user_id)
api.approve_user_request(user_id)
api.ignore_user_request(user_id)
api.user_relationship(user_id)
```

Media: http://instagr.am/developer/endpoints/media/

``` python
api.media(media_id)
api.media_popular(count, max_id)
api.media_search(q, count, lat, lng, min_timestamp, max_timestamp)
```

Comments: http://instagr.am/developer/endpoints/comments/

``` python
api.media_comments(media_id)
api.create_media_comment(media_id, text)
api.delete_comment(media_id, comment_id)
```

Likes: http://instagr.am/developer/endpoints/likes/

``` python
api.media_likes(media_id)
api.like_media(media_id)
api.unlike_media(media_id)
```

Tags: http://instagr.am/developer/endpoints/tags/

``` python
api.tag(tag_name)
api.tag_recent_media(count, max_tag_id, tag_name)*
api.tag_search(q, count)*
```

Locations: http://instagr.am/developer/endpoints/locations/

``` python
api.location(location_id)
api.location_recent_media(count, max_id, location_id)*
api.location_search(q, count, lat, lng, foursquare_id, foursquare_v2_id)
```

Geographies: http://instagr.am/developer/endpoints/geographies/

``` python
api.geography_recent_media(count, max_id, geography_id)*
```

Error handling
------
Importing the bind module allows handling of specific error status codes. An example is provided below:
``` python
from instagram.bind import InstagramAPIError

try:
# your code goes here
except InstagramAPIError as e:
if (e.status_code == 400):
print "\nUser is set to private."
```

Trouble Shooting
------

If you get an error of a module not being defined during the Instagram import call, this might update a necessary package.
```
sudo pip install --upgrade six
```

Sample app
------
We also provide a one-file sample app using bottle (you'll have to 'pip install bottle' first). To try it out:
This repository includes a one-file sample app that uses the bottle framework and demonstrates
authentication, subscriptions, and update processing. To try it out:

* Set your redirect URI to 'http://localhost:8515' in your dev profile
* Open up sample\_app.py, update it with your client\_id and secret
* Download bottle if you don't already have it: pip install bottle
* Download bottle-session if you don't already have it: pip install bottle-session
* Download and run a redis instance on port 6379 if you don't already have it. Check http://redis.io for instructions.
* Set your redirect URI to 'http://localhost:8515/oauth_callback' in your dev profile
* Open up sample\_app.py, update it with your client\_id and secret, and set redirect URI to 'http://localhost:8515/oauth_callback'
* Run the file; it will host a local server on port 8515.
* Try visiting http://localhost:8515 in your browser

Contributing
------------
In the spirit of [free software](http://www.fsf.org/licensing/essays/free-sw.html), **everyone** is encouraged to help improve this project.

Here are some ways *you* can contribute:

* by using alpha, beta, and prerelease versions
* by reporting bugs
* by suggesting new features
* by writing or editing documentation
* by writing specifications
* by writing code (**no patch is too small**: fix typos, add comments, clean up inconsistent whitespace)
* by refactoring code
* by closing [issues](http://github.com/Instagram/python-instagram/issues)
* by reviewing patches


Submitting an Issue
-------------------
We use the [GitHub issue tracker](https://github.com/Instagram/python-instagram/issues) to track bugs and
features. Before submitting a bug report or feature request, check to make sure it hasn't already
been submitted. You can indicate support for an existing issue by voting it up. When submitting a
bug report, please include a [Gist](http://gist.github.com/) that includes a stack trace and any
details that may be necessary to reproduce the bug, including your version number, and
operating system. Ideally, a bug report should include a pull request with failing specs.


Submitting a Pull Request
-------------------------
1. Fork the project.
2. Create a topic branch.
3. Implement your feature or bug fix.
4. Run <tt>python tests.py </tt>.
5. Add a test for your feature or bug fix.
6. Run <tt>python tests.py </tt>. If your changes are not 100% covered, go back to step 5.
7. Commit and push your changes.
8. Submit a pull request.
9. If you haven't already, complete the Contributor License Agreement ("CLA").

Contributor License Agreement ("CLA")
_____________________________________
In order to accept your pull request, we need you to submit a CLA. You only need
to do this once to work on any of Instagram's or Facebook's open source projects.

Complete your CLA here: [https://code.facebook.com/cla](https://code.facebook.com/cla)


Copyright
---------
Copyright (c) 2014, Facebook, Inc. All rights reserved.
By contributing to python-instagram, you agree that your contributions will be licensed under its BSD license.
See [LICENSE](https://github.com/Instagram/python-instagram/blob/master/LICENSE.md) for details.
Binary file added dist/python-instagram-1.0.0.tar.gz
Binary file not shown.
Binary file added dist/python-instagram-1.0.1.tar.gz
Binary file not shown.
Binary file added dist/python-instagram-1.1.0.tar.gz
Binary file not shown.
Binary file added dist/python-instagram-1.1.1.tar.gz
Binary file not shown.
Binary file added dist/python-instagram-1.1.2.tar.gz
Binary file not shown.
Loading