A twitter bot which creates threads when given a story or rant as input
- Build a frontend interface in React for taking a user's story
- Use fetch or async await to interact with twitter Api
- Connect to twitter API with API key
- Create tweet objects
- Create a twitter thread with tweet objects
- Twitter API key of the account that will be posting the tweets
- PassportJS - for user authentication
- Twit - to interface with Twitter Api
- Sign up for a free Twitter account with your email here
- Make sure to verify your account. They'll send an email verification when you sign up
- Apply for a Twitter developer account with the Twitter account you just created here
- Create a 'twitter app' in the developer dashboard here. You can read more about getting started with the developer account here
- In the details of the app, enable
Sign in with Twitterand addhttp://127.0.0.1:5000/twitter-callbackas a Callback URL - After creating the app, you can access your API keys under the 'Keys and Tokens' tab in the details view of your twitter app
- After cloning this repository, run
yarnin the root folder to install express dependencies cd clientand runnpm installto install React dependencies
- Rename the
.env.examplefile in the project root to.env - Replace the values with your own actual values EXCEPT
DB_NAME - Type
mysql -u root -pto access the MySQL CLI using your password. - In the MySQL CLI, type
create database twitter;to create a database in MySQL. - Exit the MySQL CLI and run
npm run migratein your TERMINAL, in the root folder of your project (not your MySQL CLI!). This will create a table called 'access_keys' in your twitter database.
- Run
yarn startin project directory to start the Express server on port 5000 cd clientand runnpm startto start client server in development mode with hot reloading in port 3000.
- The app starts with a login page served from express at http://localhost:5000/login
- This eventually redirects to the app page in express on http://localhost:3000/
The app should also take the title of the story and make that the first tweet in a thread and append '- A thread' to it. For example, if the title of a story is "Little Red Riding Hood", the first tweet in the thread will be "Little Red Riding Hood - A thread". The rest of the tweets in the thread will be the story
After a user submits a story, the app should show a modal giving feedback (success or failure) to the user on whether the thread has been posted or not.
The login page is currently in a .ejs file in the views folder views/login.ejs. I'd like to make a React page which redirects to the /twitter-login route of the express server
I'd like to save user information as well as the stories they've shared in a database and show twitter stats on the stories they've posted. So everytime they log into the app, they'll see a list of the stories they've written and posted as well as the twitter statistics on these stories
This is a student project that was created at CodeOp, a full stack development bootcamp in Barcelona.


