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 🫶
If you find a bug throughout your development or testing process, please do not hesitate to file an issue describing the bug you noticed.
Here is how you create an issue:
- Go to the issues tab.
- Click on "New issue".
- Add an informative title following the naming convention below.
- Add a detailed description with the suggested solution if possible.
- Select applicable labels after reading each label's description.
If you want to start working on a new feature/fix a bug, create a new branch with a descriptive title preceded by your name as @yourname/new-feature-title
.
Note: branch names are all small cases separated by a dash -
, e.g. @hady/twitter-api-migration
The commit message should be structured as follows:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
The commit contains the following structural elements:
-
fix: a commit of the type
fix
patches a bug in the codebase. -
feat: a commit of the type
feat
introduces a new feature to the codebase. -
BREAKING CHANGE: a commit that has a footer
BREAKING CHANGE:
, or appends a!
after the type/scope, introduces a breaking change. -
types other than fix: and feat: are allowed, for example
build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
, and others.
Refer to Conventional Commits for more information.
- Small letters only.
- Use underscore as delimiters.
- Keep it short, clear, and simple.
Examples :
date_helper.ts
settings_controller.ts
This project is intended to be used with the latest Active LTS release of Node.js.
To clone this repo:
-
Open a new
terminal
/powershell
window. -
Clone the repo:
git clone https://github.com/hadysata/KFUPM-semester-progress-bar.git
-
Open the project in your favorite IDE/Code editor
- In the project root folder, run
npm i && cd functions && npm i
- 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
)
- 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
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
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.
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.
Licensed under the APLv2. See the LICENSE file for details.