API Docs :- https://documenter.getpostman.com/view/24098668/2s8YCjBr9o
How it works?
Bot
This is what the visual of the bot looks like:
- When the endpoint of the bot gets triggered by the cron-job, the postNewTweet() function in PostNewTweet.kt will trigger the Twitter endpoint through the Twitter4J library, which will post the data that is fetched from fetchRandomPost().
- fetchRandomPost() retrieves random data from a randomly selected subreddit.
- The same data that is sent to Twitter via bot will be added to a database using addNewPostToDB(), which you can retrieve through the API.
API
This is what the visual of the API looks like:
- When the previousPosts endpoint gets triggered, data that is posted by the bot will be retrieved from the database.
- When the previous post with a date filter added in the parameter gets triggered, the API will return filtered data from the database.
API Docs :- https://documenter.getpostman.com/view/24098668/2s8YCjBr9o
Tech Stack
- Ktor…