From fde23f5ba3cdafebacd371ab780d3e33959e249e Mon Sep 17 00:00:00 2001 From: onenonelee <48991298+onenonelee@users.noreply.github.com> Date: Thu, 28 Mar 2019 01:02:57 +0900 Subject: [PATCH] Update InstagramAPI.py --- InstagramAPI/InstagramAPI.py | 49 ++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/InstagramAPI/InstagramAPI.py b/InstagramAPI/InstagramAPI.py index 6e29913..8432975 100644 --- a/InstagramAPI/InstagramAPI.py +++ b/InstagramAPI/InstagramAPI.py @@ -1,4 +1,23 @@ -#!/usr/bin/env python +Skip to content + +Search or jump to… + +Pull requests +Issues +Marketplace +Explore + +@onenonelee Sign out +146 +1,740 615 LevPasha/Instagram-API-python + Code Issues 163 Pull requests 42 Projects 0 Wiki Insights +Instagram-API-python/InstagramAPI/InstagramAPI.py + Егор Малышев Added searchLocations() method. +ed74ee4 on 28 Sep 2018 +@LevPasha @ri7nz @westscz @raphasousa @Rahandi @DigitalForecast @xecgr @desecho @darland @jamesbrink +1069 lines (927 sloc) 57.5 KB + +#!/usr/bin/env python # -*- coding: utf-8 -*- import requests @@ -78,7 +97,6 @@ def setUser(self, username, password): def setProxy(self, proxy=None): """ Set proxy for all requests:: - Proxy format - user:password@ip:port """ @@ -735,6 +753,21 @@ def searchLocation(self, query): locationFeed = self.SendRequest('fbsearch/places/?rank_token=' + str(self.rank_token) + '&query=' + str(query)) return locationFeed + def geosearchLocations(self, lat, lng): + """ + Search for nearby Instagram locations by geographical coordinates + :rtype: bool + :param lat: latitude + :param lng: longitude + """ + query = "location_search?latitude={lat}&longitude={lng}&rank_token={token}".format( + lat=str(lat), + lng=str(lng), + token=self.rank_token, + ) + locations_status = self.SendRequest(query) + return locations_status + def getLocationFeed(self, locationId, maxid=''): return self.SendRequest('feed/location/' + str(locationId) + '/?max_id=' + maxid + '&rank_token=' + self.rank_token + '&ranked_content=true&') @@ -1050,3 +1083,15 @@ def getTotalLikedMedia(self, scan_rate=1): except KeyError as e: break return liked_items +© 2019 GitHub, Inc. +Terms +Privacy +Security +Status +Help +Contact GitHub +Pricing +API +Training +Blog +About