Scraping 101: Prayer Times
Prayer Times
A quick access to prayer times. Put this in your Termux
P1
Add the following alias to .bashrc
alias p1="curl https://www.islamicfinder.org/|grep '[0-9]\{2\}:[0-9]\{2\} .M'"
They type p1
in the command line.
P2 = prayertimes.py
This script is not as fast as p1
but its output is better looking and systematic. You can download this script from this repository and run it through
python prayertimes.py
Then add an alias P2 = python prayertimes.py
.
Prerequisites
This python script requires the following modules (available through pip)
- requests -
pip install requests
- beautiful soup -
pip install bs4
See this tutorial on youtube to learn more about the usage of these two modules.
P3
Add the following alias to .bashrc (it is a clean up of the output of p1 by using SED)
alias p3="curl https://www.islamicfinder.org/|grep '[0-9]\{2\}:[0-9]\{2\} .M'|sed 's/<span class="todayPrayerTime">//'|sed 's/<span class=\"todayPrayerTime\">//'|sed 's/<\/span>//'"
Then type p3
in the command line