from apontador import ApontadorAPI keys = open("keys.txt", "r") CONSUMER_KEY = keys.readline().split("=")[1].strip() CONSUMER_SECRET = keys.readline().split("=")[1].strip() OAUTH_TOKEN = keys.readline().split("=")[1].strip() OAUTH_TOKEN_SECRET = keys.readline().split("=")[1].strip() USERID = keys.readline().split("=")[1].strip() print CONSUMER_KEY print CONSUMER_SECRET print OAUTH_TOKEN print OAUTH_TOKEN_SECRET api = ApontadorAPI(consumer_key=CONSUMER_KEY, consumer_secret=CONSUMER_SECRET, oauth_token=OAUTH_TOKEN, oauth_token_secret=OAUTH_TOKEN_SECRET) ###################################################### # Basic Auth calls ###################################################### response = api.get_user(userid=USERID, type="json") print response print response = api.get_user_places(userid=USERID, type="json") print response print response = api.get_user_reviews(userid=USERID, type="json")
from apontador import ApontadorAPI keys = open("keys.txt", "r") CONSUMER_KEY = keys.readline().split("=")[1].strip() CONSUMER_SECRET = keys.readline().split("=")[1].strip() OAUTH_TOKEN = keys.readline().split("=")[1].strip() OAUTH_TOKEN_SECRET = keys.readline().split("=")[1].strip() USERID = keys.readline().split("=")[1].strip() print CONSUMER_KEY print CONSUMER_SECRET print OAUTH_TOKEN print OAUTH_TOKEN_SECRET api = ApontadorAPI(consumer_key = CONSUMER_KEY, consumer_secret = CONSUMER_SECRET, oauth_token = OAUTH_TOKEN, oauth_token_secret = OAUTH_TOKEN_SECRET) ###################################################### # Basic Auth calls ###################################################### response = api.get_user(userid=USERID, type="json") print response print response = api.get_user_places(userid=USERID, type="json") print response print
import pickle import time import simplejson #Simple Crawler of Places at Apontador #CONSUMER_KEY = "KpsWD7ynRUXINRFkml8Q-xIUA5LT_fY8OT5h1VZr0Uc~" #CONSUMER_SECRET = "68vdw3xwgy-eM0iRDlMLFF418IQ~" #OAUTH_TOKEN = '9153904622-KpsWD7ynRUV_0-8wQQnXgBZZ9XHYj__xfMhJ3aexK9HVyxdBcXZa4A~~' #OAUTH_TOKEN_SECRET = 'jqgnH6aV6-VQKOQyiLIu_-0ZQIQ~' #USERID = '9153904622' api = ApontadorAPI(consumer_key = CONSUMER_KEY, consumer_secret = CONSUMER_SECRET, oauth_token = OAUTH_TOKEN, oauth_token_secret = OAUTH_TOKEN_SECRET) output_file = open('dataset.txt', 'a') class ApontadorExtractor(threading.Thread): def __init__(self,out_queue): threading.Thread.__init__(self) self.out_queue = out_queue def extractReviews(self, reviewsLimit=200): page = 1 reviews_list = [] reviewsFlag = True