I'd like to automatically read in data that is sent on a private twitter stream where I've been granted access to.
From the documentation I see no chance to place my authentification credentials anywhere, or am I missing something?
Anyhow, I need this feature and will gladly sponsor you if you could implement it.
You would have to add Cookies section into the headers https://github.com/twintproject/twint/blob/c5c6f1d60554cd0ee64ba223850b070553a17e74/twint/run.py#L57 with your valid cookie, and then run the script periodically
Btw Twitter should have a Streaming API
Hi Pielco, thanks for the quick reply! :)
Well, doesn't the API of Twitter require a developer token? Due to the very simple task I wouldn't need that.
So I don't need to send auth data with every request but create a cookie section?
Yes, the official Twitter API requires a token to be used.
Twitter recognizes you by cookie, since you don't need to login everytime if your browser does not delete the cookies when you exit, for example.
You could apply a sort of auth, I would go straight forward with the cookies.
Please consider that Twitter may recognize your activity like a malicious one, you could get suspended or permanently banned in the WCS (Worst Case Scenario).
Thx for the reply. Well, basically I just need quite a calm check for incoming updates from a private stream. Checking once per minute would be enough. So you think Twitter would ban me for that? :/
Would you recommend to read incoming data passively rather than actively pulling - e.g. via Selenium?
Well, maybe once per minute is not that much so I guess nothing bad will happen to your account.
I'd read incoming data, this does not mean that actively pulling is a bad idea.
I've done some testing with just a few requests and my account got suspended (I had to click the "I'm no robot" checkbox to reactivate).
So, I guess scrapping a private stream even with credential data sent in a cookie is still being considered as suspicious activity.
I'm going the Selenium way then. Thanks for the nice feedback though. Cheers!