DocNow / diffengine

track changes to the news, where news is anything with an RSS feed
MIT License
177 stars 30 forks source link

CLI command for generating tokens for extra twitter accounts #69

Closed nahuelhds closed 4 years ago

nahuelhds commented 4 years ago

You can now execute diffinengine with --add flag to receive the Twitter auth URL and use it for getting the tokens for the account you wanna add to the config yaml.

Usage example

$ diffengine --add

Log in to https://twitter.com as the user you want to tweet as and hit enter.
Visit https://api.twitter.com/oauth/authorize?oauth_token=QKGAqgAAAAABDsonAAABcbfQfFw in your browser and hit enter.
What is your PIN: 1234567

These are your access token and secret.
DO NOT SHARE THEM WITH ANYONE!

access_token
xxxxxxxxxxx-yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy

access_token_secret
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

This way you can copy&paste the token in your own config.yaml file

edsu commented 4 years ago

Awesome! I kind of like the subcommand style (from git) so diffengine add instead of diffengine --add but I think this works for now, and it can easily be updated later if we need to.

nahuelhds commented 4 years ago

I agree with your observation, Ed. Go with it!

nahuelhds commented 4 years ago

PS: I've fixed the "Y/n" option to actually get the default value as a "Y" when the user just hits Enter when the config is built for the first time