I
I
ITA_Lenin2014-04-23 15:31:29
Python
ITA_Lenin, 2014-04-23 15:31:29

Python, twitAapi v1.1 - how to fix an error in the parameters?

The bottom line is this:
For the thesis, you need to write a bot for Twitter. While I was learning to pass authorization and studying ready-made examples, etc., I ran into the problem of passing parameters using twitAPI. Since there was a transition from api v1.0 to api v1.1 in the summer, there are no clues. After studying dev.twitter.com/docs/api/1.1, nothing became clear in principle, as they say "I look in a book, I see a fig." Google didn't turn up anything either.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
import tweepy, time, sys
 
argfile = str(sys.argv[1])
 
CONSUMER_KEY = '123456' #тут и далее подставляю свои значения ключей#
CONSUMER_SECRET = '123456'
ACCESS_KEY = '12345'
ACCESS_SECRET = '123456'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
api = tweepy.API(auth, secure=True)
 
filename=open(argfile,'r')
f=filename.readlines()
filename.close()
 
for line in f:
    api.update_status(line) #РУГАЕТСЯ ИМЕННО НА ЭТУ СТРОЧКУ#
    time.sleep(900)

Help, good people.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question