Skip to content

A Twitter bot that tweets the current progress of a KFUPM current semester

License

Notifications You must be signed in to change notification settings

hadysata/KFUPM-semester-progress-bar

Repository files navigation

KFUPM Semester Progress Twitter Bot

TypeScript version Node.js version APLv2 Build Status - GitHub Actions

A Twitter bot that tweets the current progress of the KFUPM current semester.

The tweet will look something like this:

 [🁢🁢🁢🁢🁢🁢🁢🁢🁢🁢🁢🁢🁢🁢🁢🁢🁢🁢🁢🁢]100% 🎉

130/130 days left 🗓

Today: Last day for faculty to submit grades to the Deanship (2:00 PM);Official Graduation Date 💡


#KFUPM

Don't forget to follow the bot account KFUPM_SP 🫶

Table of Contents

Contribute to This Project

See the contributing guide for detailed instructions on how to get started with this project.

We accept any type of contribution, including some that don't require you to write a single line of code.

Build, Run and Deploy

This project is intended to be used with the latest Active LTS release of Node.js.

Clone Repository

To clone this repo:

  1. Open a new terminal/powershell window.

  2. Clone the repo:

    git clone https://github.com/hadysata/KFUPM-semester-progress-bar.git
  3. Open the project in your favorite IDE/Code editor

Setup

  1. In the project root folder, run
npm i && cd functions && npm i
  1. If you wish to use Firebase cloud functions, run:
npm install -g firebase-tools
cd functions && firebase init

Follow the instructions in your CLI, and make sure to setup Firebase cloud functions(Your Firebase project plan should be Blaze)

  1. In the project root folder, create a new .env file with the following variables:
APP_KEY=""
APP_SECRET=""
ACCESS_TOKEN=""
ACCESS_SECRET=""

These are Twitter keys used by the bot to use Twitter API; you can get these keys from Twitter developer portal

Run

To run the script, in the project root folder run:

npm run build
npm run start

To run the simulator, run:

npm run start:simulator

To run the bot on Firebase cloud functions, run:

cd fuctions
npm run serve

Deploy

To deploy the bot script to Firebase cloud functions, run:

cd fuctions
firebase deploy

You could also run this script on other cloud platform such as Heroku or Railway; just make sure to setup a cron job/scheduler to run this script in any time interval you want.

What is a simulator?

The simulator script will simulate and try to generate whole semester tweets; this script is connected to Github workflow, so any changes that break the simulator will result in a failing test.

License

Licensed under the APLv2. See the LICENSE file for details.