unurgunite/pdf_uploader
A Ruby Telegram Bot which sends you files from given "Index of" resources
PdfUploader
Honestly, I don't know why I have to name this project as it is now.
This project is a personal Ruby Telegram Bot which could help you to store links from "Index of" resources.
Documentation content
Overview
This project could help you to store files from "Index of" resources inside Telegram.
Installation
Firstly, you'll need Ruby 2.7 or above (but I think it will work on legacy versions too). I recommend to use rbenv to
manage your Rubies.
After building Ruby install the project and download dependencies:
git clone https://github.com/unurgunite/pdf_uploader.git && \
cd pdf_uploader && \
bundle installIf everything downloaded without any errors, go to BotFather to get Telegram API token. We
should store it somewhere, so create a file .env at project's root as below:
echo 'TELEGRAM_TOKEN=YOUR-TOKEN-HERE' > .envUsage
Now everything should work fine. Type in your terminal:
bundle exec ruby main.rbAnd follow to your bot.
Commands
Here is a table with common commands which bot could serve.
| Commands | Description |
|---|---|
/start |
Start the bot |
/upload_url |
Upload url to get files from resource |
/help |
Print all commands |
TODO
The current parser implementation does not support links other than in "Index of" format, so I would be glad to receive
a support.
Requirements
Here is a table showing all dependencies for this project.
| Dependencies | Description |
|---|---|
| telegram-bot-ruby | A library for communication with Telegram Bot API |
| nokogiri | A library for parsing and analyzing XML sources |
| httparty | A library for making requests easily (than via Net::HTTP) |
| dotenv | A library for storing sensitive information (API token, for e.g.) |
| rbs | A library for creating a type signatures (ONLY FOR DEVELOPMENT!) |
| debug | A library for debugging Ruby code evaluating (ONLY FOR DEVELOPMENT!) |
| rubocop | A library for code cleaning (ONLY FOR DEVELOPMENT!) |
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/unurgunite/pdf_uploader. This project is
intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
the code of conduct. To contribute you
should
fork this project and create there new branch:
git clone https://github.com/your-beautiful-username/pdf_uploader.git && \
git checkout -b refactor && \
git commit -m "Affected new changes" && \
git push origin refactorAnd then make new pull request with additional notes of what you have done. The better the changes are scheduled, the
faster the PR will be checked.
Code of Conduct
Everyone interacting in the PdfUploader project's codebases, issue trackers, chat rooms and mailing lists is expected
to follow the code of conduct.
License
The project is available as open source under the terms of
the 3-Clause BSD License. The copy of the license is stored in project
under the LICENSE.txt file
name: copy of the License
The documentation is available as open source under the terms of
the CC BY-SA 4.0 License