22from .bind import bind_method
33from .models import MediaShortcode , Media , User , Location , Tag , Comment , Relationship
44
5- MEDIA_ACCEPT_PARAMETERS = ["count" , "max_id" ]
5+ MEDIA_ACCEPT_PARAMETERS = ["count" ]
66SEARCH_ACCEPT_PARAMETERS = ["q" , "count" ]
77
88SUPPORTED_FORMATS = ['json' ]
@@ -17,7 +17,7 @@ class InstagramAPI(oauth2.OAuth2API):
1717 access_token_url = "https://api.instagram.com/oauth/access_token"
1818 protocol = "https"
1919 api_name = "Instagram"
20- x_ratelimit_remaining = None
20+ x_ratelimit_remaining = None
2121 x_ratelimit = None
2222
2323 def __init__ (self , * args , ** kwargs ):
@@ -28,11 +28,6 @@ def __init__(self, *args, **kwargs):
2828 raise Exception ("Unsupported format" )
2929 super (InstagramAPI , self ).__init__ (** kwargs )
3030
31- media_popular = bind_method (
32- path = "/media/popular" ,
33- accepts_parameters = MEDIA_ACCEPT_PARAMETERS ,
34- root_class = Media )
35-
3631 media_search = bind_method (
3732 path = "/media/search" ,
3833 accepts_parameters = SEARCH_ACCEPT_PARAMETERS + ['lat' , 'lng' , 'min_timestamp' , 'max_timestamp' , 'distance' ],
@@ -94,20 +89,21 @@ def __init__(self, *args, **kwargs):
9489 root_class = Media )
9590
9691 user_media_feed = bind_method (
97- path = "/users/self/feed " ,
98- accepts_parameters = MEDIA_ACCEPT_PARAMETERS ,
92+ path = "/users/self/media/recent " ,
93+ accepts_parameters = MEDIA_ACCEPT_PARAMETERS + [ "min_id" , "max_id" ] ,
9994 root_class = Media ,
10095 paginates = True )
10196
10297 user_liked_media = bind_method (
10398 path = "/users/self/media/liked" ,
104- accepts_parameters = MEDIA_ACCEPT_PARAMETERS ,
99+ accepts_parameters = MEDIA_ACCEPT_PARAMETERS + [ "max_like_id" ] ,
105100 root_class = Media ,
106101 paginates = True )
107102
108103 user_recent_media = bind_method (
109104 path = "/users/{user_id}/media/recent" ,
110- accepts_parameters = MEDIA_ACCEPT_PARAMETERS + ['user_id' , 'min_id' , 'max_timestamp' , 'min_timestamp' ],
105+ accepts_parameters = MEDIA_ACCEPT_PARAMETERS + ['user_id' , 'min_id' ,
106+ 'max_id' ],
111107 root_class = Media ,
112108 paginates = True )
113109
@@ -117,14 +113,12 @@ def __init__(self, *args, **kwargs):
117113 root_class = User )
118114
119115 user_follows = bind_method (
120- path = "/users/{user_id}/follows" ,
121- accepts_parameters = ["user_id" ],
116+ path = "/users/self/follows" ,
122117 paginates = True ,
123118 root_class = User )
124119
125120 user_followed_by = bind_method (
126- path = "/users/{user_id}/followed-by" ,
127- accepts_parameters = ["user_id" ],
121+ path = "/users/self/followed-by" ,
128122 paginates = True ,
129123 root_class = User )
130124
@@ -142,7 +136,7 @@ def __init__(self, *args, **kwargs):
142136
143137 location_search = bind_method (
144138 path = "/locations/search" ,
145- accepts_parameters = SEARCH_ACCEPT_PARAMETERS + ['lat' , 'lng' , 'foursquare_id' , 'foursquare_v2_id' ],
139+ accepts_parameters = SEARCH_ACCEPT_PARAMETERS + ['lat' , 'lng' ],
146140 root_class = Location )
147141
148142 location = bind_method (
@@ -151,12 +145,6 @@ def __init__(self, *args, **kwargs):
151145 root_class = Location ,
152146 response_type = "entry" )
153147
154- geography_recent_media = bind_method (
155- path = "/geographies/{geography_id}/media/recent" ,
156- accepts_parameters = MEDIA_ACCEPT_PARAMETERS + ["geography_id" ],
157- root_class = Media ,
158- paginates = True )
159-
160148 tag_recent_media = bind_method (
161149 path = "/tags/{tag_name}/media/recent" ,
162150 accepts_parameters = ['count' , 'max_tag_id' , 'tag_name' ],
@@ -216,9 +204,6 @@ def _make_subscription_action(method, include=None, exclude=None):
216204 "aspect" ,
217205 "object_id" , # Optional if subscribing to all users
218206 "callback_url" ,
219- "lat" , # Geography
220- "lng" , # Geography
221- "radius" , # Geography
222207 "verify_token" ]
223208
224209 if include :
0 commit comments