|
1 | | -#!/usr/bin/env python |
| 1 | +Skip to content |
| 2 | + |
| 3 | +Search or jump to… |
| 4 | + |
| 5 | +Pull requests |
| 6 | +Issues |
| 7 | +Marketplace |
| 8 | +Explore |
| 9 | + |
| 10 | +@onenonelee Sign out |
| 11 | +146 |
| 12 | +1,740 615 LevPasha/Instagram-API-python |
| 13 | + Code Issues 163 Pull requests 42 Projects 0 Wiki Insights |
| 14 | +Instagram-API-python/InstagramAPI/InstagramAPI.py |
| 15 | + Егор Малышев Added searchLocations() method. |
| 16 | +ed74ee4 on 28 Sep 2018 |
| 17 | +@LevPasha @ri7nz @westscz @raphasousa @Rahandi @DigitalForecast @xecgr @desecho @darland @jamesbrink |
| 18 | +1069 lines (927 sloc) 57.5 KB |
| 19 | + |
| 20 | +#!/usr/bin/env python |
2 | 21 | # -*- coding: utf-8 -*- |
3 | 22 |
|
4 | 23 | import requests |
@@ -78,7 +97,6 @@ def setUser(self, username, password): |
78 | 97 | def setProxy(self, proxy=None): |
79 | 98 | """ |
80 | 99 | Set proxy for all requests:: |
81 | | -
|
82 | 100 | Proxy format - user:password@ip:port |
83 | 101 | """ |
84 | 102 |
|
@@ -735,6 +753,21 @@ def searchLocation(self, query): |
735 | 753 | locationFeed = self.SendRequest('fbsearch/places/?rank_token=' + str(self.rank_token) + '&query=' + str(query)) |
736 | 754 | return locationFeed |
737 | 755 |
|
| 756 | + def geosearchLocations(self, lat, lng): |
| 757 | + """ |
| 758 | + Search for nearby Instagram locations by geographical coordinates |
| 759 | + :rtype: bool |
| 760 | + :param lat: latitude |
| 761 | + :param lng: longitude |
| 762 | + """ |
| 763 | + query = "location_search?latitude={lat}&longitude={lng}&rank_token={token}".format( |
| 764 | + lat=str(lat), |
| 765 | + lng=str(lng), |
| 766 | + token=self.rank_token, |
| 767 | + ) |
| 768 | + locations_status = self.SendRequest(query) |
| 769 | + return locations_status |
| 770 | + |
738 | 771 | def getLocationFeed(self, locationId, maxid=''): |
739 | 772 | return self.SendRequest('feed/location/' + str(locationId) + '/?max_id=' + maxid + '&rank_token=' + self.rank_token + '&ranked_content=true&') |
740 | 773 |
|
@@ -1050,3 +1083,15 @@ def getTotalLikedMedia(self, scan_rate=1): |
1050 | 1083 | except KeyError as e: |
1051 | 1084 | break |
1052 | 1085 | return liked_items |
| 1086 | +© 2019 GitHub, Inc. |
| 1087 | +Terms |
| 1088 | +Privacy |
| 1089 | +Security |
| 1090 | +Status |
| 1091 | +Help |
| 1092 | +Contact GitHub |
| 1093 | +Pricing |
| 1094 | +API |
| 1095 | +Training |
| 1096 | +Blog |
| 1097 | +About |
0 commit comments