S
S
S0ulReaver2012-01-05 17:14:14
Python
S0ulReaver, 2012-01-05 17:14:14

Python - Twitter Client

Basically what happened. A couple of days ago, in the process of learning Python and QT, I decided to write a simple program that displays a list of the latest tweets. I used oauthtwitter (http://code.google.com/p/oauth-python-twitter2/), python-oauth2 (https://github.com/brosner/python-oauth2) for implementation. Everything turned out, I wrote the program, and for the sake of interest I also put the file into the .exe. Well, today I launch .exe - but there is no tape! Well, I think it’s something strange, like the rule “it works - don’t touch it” is followed, why break there? Got into the code, it turned out that oauthtwitter could not log in. I looked at what was happening - oauth returns a 401 error as a response to a RequestToken request. Well, here, due to my illiteracy, I refused to understand what happened next. I checked the Consumer key and Consumer secret - everything is correct, there is no error. I even registered a new application with new keys - the same thing. Actually, if you follow the example of oauth2 without oauthtwitter, then the error is exactly the same (which is not surprising if I correctly understood oauthtwitter for oauth2 access and uses it). Those. again with code:

import oauthtwitter

twitter = oauthtwitter.OAuthApi(CONSUMER_KEY, CONSUMER_SECRET)
temp_credentials = twitter.getRequestToken()

Response: 401 error.

The question is - what could go wrong in a day, where to dig, in what place am I a fool?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
S0ulReaver, 2012-01-05
@S0ulReaver

Oh, after one day of total not understanding what was happening, the answer was found. It's funny even. You see, today my clock was moved an hour ago, which did not coincide with the time on the Twitter servers, and it refused to accept the request. I set the correct time, everything worked.
Now, in general, I have only one question - what the hell? The wrong time can be set for a huge number of users, and the operation of the program obviously should not depend on it. Something tells the exact time, you need to find out on the Internet, and somehow screw it up, but I still don’t know which side to approach.

R
ring0za, 2014-04-06
@ring0za

Here is an example of using the ntplib library

V
Vladislav, 2014-10-12
@McClay

Python is not a Twitter client.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question