python-twitter-tools / twitter

Python Twitter API
http://mike.verdone.ca/twitter/
MIT License
3.17k stars 710 forks source link

Can it support custom action? #432

Open ayanamist opened 3 years ago

ayanamist commented 3 years ago

I want to use this tool to bulk block some spam users, however, it does not have a "block" action so i have to pull cmdline.py down, modify and replace it to add this action. Can cmdline add such ability: when invoke as twitter blocks create screen_name=xxxxx, it will perform blocks/create api call with param screen_name=xxxx ?

boogheta commented 3 years ago

Hello, The command line tools of this project are not really maintained, only the python library part is. But what you want to do would be quite easy to do with a simple script such as something like this:

from twitter import Twitter, OAuth
t = Twitter(auth=OAuth(token, token_secret, consumer_key, consumer_secret))
t.blocks.create(screen_name="xxxxxx")