A simple program built using the Spring framework for Java that allows archiving tweets onto an Amazon Web Services DynamoDB database. The frontend is built as a single-page-application using React, and communicates to the REST API on the backend using Axios.
There are three steps in order to set up the Archiver.
There must be valid AWS credentials in the .aws folder in the home directory ~/.aws, typically in the form of file named config structured like below:
[default]
region = us-west-2
output = json
aws_access_key_id = accessKey
aws_secret_access_key = secretKey
Replace with the preferred region and the keys for the desired AWS account.
Next you must create/edit an application.properties file that will store a bearer token - an alphanumeric key provided by the Twitter Developer Portal and required to access the Twitter API.
The application.properties file is used to set various properties in the Spring framework. In this case, it will allow us a place to store the bearer token that we can avoid publishing to git. The only field required is shown below:
bearer.token=${BEARER_TOKEN:bearerToken}
You must have Node Package Manager installed to properly build the frontend. Once it is installed, navigate to the TwitterArchiver/frontend folder in your command line and run the following commands:
npm install
npm run build
The backend sets up a local Apache-Tomcat server (default port set to 8080) and is run from the App file in the src.main.java package.
The frontend is run by navigating to the TwitterArchiver/frontend folder in your command line and running the following command:
npm start
Once both components are running you should be able to view the app on the default frontend port at http://localhost:3000/
The current beta release prompts for a converted user id (roadmap includes allowing Twitter handle input directly). You can convert the Twitter handle (what is shown in the users profile URL) of the user you wish to archive tweets from into a converted user id at this website.
- Format README
- Check this box
- Merge frontend
- Archive Tweets by User
- Add user input with Twitter handle directly instead of requiring user to convert it
- Archive Followers by User
- Archive Likes by Tweet
- Package frontend and backend into one-click solution (.jar? .exe?)