Search code examples
python-3.xtwitter

Calling code on a push Twitter notification


Is there an API provided by Twitter to call back some code on a push notification?

I would like to execute some code when someone I am following is tweeting.

Looked at TweePy but it does not seem to implement callbacks for push notifications.


Solution

  • I think you could use the streaming API (with TweePy) and filter for the accounts you follow e.g.:

    stream.filter(follow=['@user1',...])

    You get the users you follow by calling: GET friends/list Twitter API

    You can then call any callback you like per tweet that is found... works but needs a permanently running (small ressource consuming) process...

    There also seems to be something like the Account Activity API which looks good but seems to be "enterprise" ... or premium this page does not mention enterprise needed...(now premium ??)

    But I personally don't know what you need for premium or enterprise access...