Skip to content

debakarr/fetch-random-tech-tweet-backend

Repository files navigation

Backend for Random Tech Tweet Generator

What is this?

This is a backend for Fetch Random Tech Tweet application. This repository is automatically updated using git-auto-commit-action.

How it works?

  • It uses Twitter API to fetch latest tweets from users defined under assets/watchlist.yml file.
  • Each user have category of tweet define under them. Each category has a name and a regex which will be used to determine if a tweet falls under a specific category. If a tweet doesn't fall under specified categories defined in the watchlist file then it is considered as 'Others' category.
  • Once every 5 min (or more as per the GitHub action job schedule preference), we will use the Twitter API to fetch latest tweets from the users in config file and update a database.
  • At the end this database is converted into JSON and pushed in the same repository.
  • This JSON is used to host a REST API using json-server. API is hosted using Vercel using json-server-vercel template.

Flow diagram

How to add new user to watch list?

We can modify the assets/watchlist.yml. Just add a new user followed by the tweet category and regex to identify the tweet.

Link to REST endpoint: https://fetch-random-tech-tweet-backend.vercel.app/

Releases

No releases published

Packages

No packages published