Skip to content

A simple python script which scrapes a particular day's Pachanga from "https://www.drikpanchang.com/", stores it in a JSON file and sends a formatted message from the JSON file to a telegram group.

Notifications You must be signed in to change notification settings

nagarajanmolrao/JuttuPujariPanchanga

Repository files navigation

JuttuPujariPanchanga

A simple python script which scrapes a particular day's Pachanga from "https://www.drikpanchang.com/" ,stores it in a JSON file and sends a formatted message from the JSON file to a telegram group.

The project name "JuttuPujariPanchanga" is simply a funny name that I came with and means no disrespect to any individual or any profession.

DESCRIPTION

This main idea for the development of this program was to have a minimalist way of reading the panchanga of the day. This program uses an amazing module, called the "BeautifulSoup", which plays the major role in getting the data from the website to a normal form. Basically , for a lay man, all it does is, it parses the HTML source code and offer a handful functions to find and retrieve what is required in an easy way.

More on it can be found here : [https://realpython.com/beautiful-soup-web-scraper-python/]

The URL of the DrikPanchang site itself contains many query parameters:

So with the help of these parameters one can generate panchanga for any location and for any date you want.

Moreover the program overwrites the JSON file ,"panchangam.json" every time the program runs.

INSTALLATION

  • Clone the GitHub repository and change into the directory

    git clone https://github.com/nagarajanmolrao/JuttuPujariPanchanga

  • Copy the "telegram_details_template.json" to "telegram_details.json"

  • Put in the actual Bot token and the Telegram Group Chat ID in "telegram_details.json" file

  • Install the python dependencies

    pip install -r requirements.txt

  • Just run the "main.py" file

    python main.py

  • See the panchanga appear on your telegram group.

DOCKER INSTRUCTIONS
  • Clone the GitHub repository and change into the directory

    git clone https://github.com/nagarajanmolrao/JuttuPujariPanchanga

  • Copy the "telegram_details_template.json" to "telegram_details.json"

  • Put in the actual Bot token and the Telegram Group Chat ID in "telegram_details.json" file

  • To set at what time the message must be sent, change the time after the word "tomorrow" in the sleep command in "BotCronScript.sh" to any required time in 24HOUR format.

  • Build the docker image

    docker build . -t juttu_pujari_panchanga

  • Run the docker image

    docker run -d juttu_pujari_panchanga

About

A simple python script which scrapes a particular day's Pachanga from "https://www.drikpanchang.com/", stores it in a JSON file and sends a formatted message from the JSON file to a telegram group.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published