Skip to content

sakethpathike/catktorbot

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
API Docs :- https://documenter.getpostman.com/view/24098668/2s8YCjBr9o

How it works?

Bot

This is what the visual of the bot looks like:

botWorking.png

API

This is what the visual of the API looks like:

apiWorking.png

  • 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 - for building the bot, API, and posting respective data to the database.
  • Ktor-Client - for retrieving JSON data from subreddits(s).
  • MongoDB - for storing previous posts that are posted by the bot, which can be retrieved by the API.
  • KMongo - for chit-chatting with MongoDB.
  • Twitter4j - for interacting with the Twitter API so that the bot can post the data to Twitter.
  • Apache Commons IO - converts the URL into a file (so that the bot can tweet the image URL as an image that was retrieved from the subreddit).
  • Zeplo - for triggering the bot endpoint automatically every third hour; In other words, zeplo is used as a cron-job(s) service(if that makes sense in this context).
  • Ktor Plugins:ktor-api-key - It is a simple authentication provider for Ktor that verifies the presence of the API key from the header.
  • Render - for deploying the project using Docker.

License

MIT License

Copyright (c) 2022 Saketh Pathike

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

About

An automated bot that posts cat pictures from selected subreddits every third hour. Besides that, you can fetch the previously posted data through the API.

Topics

Resources

License

Stars

Watchers

Forks