Download scientific publications from Telegram
Original project is auino/telegram-publications-downloader.
This program allows you to set up a Telegram bot to download PDF files of scientific academic research publications from HTML URLs passed as input.
This program is written in bash scripting language.
The program is a fork of topkecleon/telegram-bot-bash, making use of dominictarr/JSON.sh.
The bot is able to interpret only messages sent during the execution of the program. If a message is sent while the program is not running, it is ignored by the bot, hence lost.
-
Create a new Telegram bot by contacting @BotFather and following official Telegram instructions
-
Clone the repository on your server:
git clone https://github.com/auino/telegram-publications-downloader.git
-
Enter the just created directory:
cd telegram-publications-downloader
-
Configure the
publicationsbot.sh
file accordingly to your needs (see Configuration section for more information) -
Run the bot:
bash publicationsbot.sh
First of all, if you're not familiar with it, consult official Telegram Bot API.
The publicationsbot.sh
program supports configuration of the following parameters:
TOKEN
identifies the Telegram token of your botOPENBOT
identifies if the bot is able to reply to anyone (OPENBOT=1
) or not (OPENBOT=0
, default and suggested feature, see Disclaimer section)ALLOWED_CHATIDS
identifies the array of chat identifiers of allowed clients (ignored ifOPENBOT=1
); a good value is for instanceALLOWED_CHATIDS=("01234" "12345")
Currently, supported services are the following ones:
Note that in order to get resources, the program has to run on a host with access to the documents.
The bot accepts the following commands:
/start
, used when a new chat is instantiated/help
, returning help information/id
, returning the chat identifier of the user sending the message/get <html_url>
to get the PDF file from a given HTML address (this is the only command applying the specified filters described in Configuration section, if any)
An apposite wiki page enlisting all available bots is available. Contact me to insert your bot into the wiki.
Using OPENBOT=1
is not recommended, since it would make anyone able to access copyrighted content.
Instead, it is suggested to limit this access and make the bot able to reply to a specific (and very limited) number of users.
Also, terms of service of the involved services should be analyzed to evaluate the possibility to use the bot on that services.
I'm not responsible of any illecit use of the program, released for educational purposes.
You can find me on Twitter as @auino.