Skip to content

πŸ“– GitHub action schedular (cron) that posts a Hadith every hour on Twitter & Facebook.

Notifications You must be signed in to change notification settings

Ananto30/hadith-every-hour

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hadith Every Hour

πŸ“– A bot that posts a Hadith every hour on Twitter & Facebook

(Every 6 hours for now to avoid spamming)

Follow on Twitter @HadithEveryHour & Facebook @HadithEveryHour

Status

Tweet Post to Facebook

Currently posting the Hadiths from Sahih al-Bukhari in serial.

Concept

It's really simple. GitHub action is written in this file. You can notice a scheduler -

on:
  schedule:
    - cron: "0 */6 * * *"

And the rest of the process is self explanatory.

A tracker is used to put the latest posted Hadith number in the hadith_track.json file.

API's are from this project - https://github.com/Ananto30/ask-hadith

Flow

Get last Tweeted Hadith number from tracker
                    β­£
          Get Hadith from API 
                    β­£
      Make chunks for long Hadith
                    β­£
   Limit chunks for very long Hadith 
                    β­£
        Tweet and comment chunks
                    β­£
       Format and post on Facebook
                    β­£
              Update tracker

Contribution

There can be a different approach of Tweeting (as Twitter has character limits on each post) or Hadith Selection, please create an issue and let's discuss about that.

About

πŸ“– GitHub action schedular (cron) that posts a Hadith every hour on Twitter & Facebook.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published