script/rest/search_twitter.py
changeset 987 18cb05f027a0
parent 982 11c1322cffe6
child 1031 5d301c2ddb89
equal deleted inserted replaced
986:fa640babbb0d 987:18cb05f027a0
    37     auth = twitter.OAuth(token=access_token[0], token_secret=access_token[1], consumer_key=consumer_key, consumer_secret=consumer_secret)
    37     auth = twitter.OAuth(token=access_token[0], token_secret=access_token[1], consumer_key=consumer_key, consumer_secret=consumer_secret)
    38     return auth
    38     return auth
    39 
    39 
    40 if __name__ == "__main__":
    40 if __name__ == "__main__":
    41 
    41 
    42     (options, args) = get_options()
    42     options = get_options()
    43     
    43     
    44     access_token = utils.get_oauth_token(consumer_key=options.consumer_key, consumer_secret=options.consumer_secret, token_file_path=options.token_filename)
    44     access_token = utils.get_oauth_token(consumer_key=options.consumer_key, consumer_secret=options.consumer_secret, token_file_path=options.token_filename)
    45     auth = get_auth(options, access_token)
    45     auth = get_auth(options, access_token)
    46 
    46 
    47     t = twitter.Twitter(domain="api.twitter.com",api_version="1.1",secure=True, auth=auth)
    47     t = twitter.Twitter(domain="api.twitter.com",api_version="1.1",secure=True, auth=auth)