This is a simple Telegram Bot made mostly for learning purposes. It is written in Python using python-telegram-bot library. You can find it in Telegram via this link.
With the help of BeautifulSoup (Python HTML parser library), I scraped Ganjoor to get recitations, poem meters and link of related songs. The code I used for this purpose can be found here.
The bot enables you to search in all Hafez poems in two ways:
- Search for one line of poem that consists of all words of query
- Search for certain words that appeared in one line of poem in the specified order and consecutively
First one is done by simply entering the desired words in any order.
And the second is done by surrounding your words with double quotes. (In both ways, the bot acts similar to what Google does.)
The result of your search can be set (via commands) to either return the whole poem or only the matching line.
There is a command to get a random poem.
The bot also supports inline queries. Meaning that you can type bot username in every telegram chat and then search for a query.
Thanks to Ganjoor, for each poem, you can receive an audio file containig recitation of the poem.
Thanks to Ganjoor, for each poem there is a list of songs that used that poem.
You receive each poem with its meter appended.