Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup initial Flask API #5

Open
BassCoder2808 opened this issue Mar 6, 2023 · 1 comment
Open

Setup initial Flask API #5

BassCoder2808 opened this issue Mar 6, 2023 · 1 comment

Comments

@BassCoder2808
Copy link

Describe the solution you'd like
This code creates a Flask application with a single endpoint /bot that accepts a POST request with a JSON payload containing the text of the tweet to be posted. It then uses the Tweepy library to authenticate with the Twitter API and post the tweet. Finally, it returns a JSON response with a success message.

Additional context
The twitter_bot() function - it extracts the tweet text from the request data and posts it to Twitter using Tweepy.

Need to replace the consumer_key, consumer_secret, access_token, and access_token_secret variables with your own Twitter API credentials in order for the bot to work.

@BassCoder2808
Copy link
Author

@Niweera would love to hear from you about the same, like how can we setup the initial flask API, I have made an attempt for the same, please let me know, like how to proceed further

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant