Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegram bot #6263

Open
LuigiImVector opened this issue Oct 15, 2021 · 21 comments
Open

Telegram bot #6263

LuigiImVector opened this issue Oct 15, 2021 · 21 comments
Assignees
Labels
help wanted Needs help solving a blocked / stucked item keep Requests exempt from being punctually stale New Feature New feature / enhancement / translation...

Comments

@LuigiImVector
Copy link
Member

It would be nice to create a telegram bot that would allow you to quickly view free resources belonging to a certain category/subcategory.
I created a small bot in python to use it as an example (it's just a concept, the code is really bad): https://gist.github.com/LuigiImVector/c748aa5801c8f3fdfeb4114eb35d1eac

The idea is to make it self-manageable, to send the resources it will save a copy of the desired file and search for the name of the desired subcategory ("Android" for example) and the program will send all the updated resources assigned to that subcategory.
There are many other ways to do this, if you like this I can help create it.

@eshellman
Copy link
Collaborator

Is there anything we need to do to enable someone to make this? Does it relate to #5778?

@LuigiImVector
Copy link
Member Author

You don't need to do anything, maybe in a few days I'll start creating a more serious bot that can be hosted for free on platforms like Heroku. I hadn't seen the API proposal, if one day they will be created the hypothetical bot would be even easier to create.

@nbehrnd
Copy link
Contributor

nbehrnd commented Oct 16, 2021 via email

@LuigiImVector
Copy link
Member Author

My idea is something much simpler and more banal @nbehrnd .
The user must indicate a language, a type of resource (books, courses...) and the subcategory (Android, C++, Java...) and the bot will download the markdown file from the github page (maybe I could use the Github API) and will search the subcategory, save it and send to the user a markdown formatted message with the links to the resources of the chosen subcategory.Nothing too complex, there are many other better ways to do this, anyway any advice is always welcome.

@davorpa davorpa added the New Feature New feature / enhancement / translation... label Oct 18, 2021
@LuigiImVector
Copy link
Member Author

LuigiImVector commented Nov 23, 2021

I finally created the telegram bot: @freeprogrammingbooks_bot.
It isn't perfect, could be better but I decided to create it this way so that it can self-maintain despite constant updates of the repository. I'm hosting the bot on heroku.

Tell me how it is.

@eshellman eshellman added the help wanted Needs help solving a blocked / stucked item label Nov 24, 2021
@eshellman
Copy link
Collaborator

Testers needed!

@stupid-kid-af
Copy link

@eshellman @LuigiImVector Bot is not giving any response. Can you please link the bot source code it would be very helpful
image

@LuigiImVector
Copy link
Member Author

Can you please link the bot source code it would be very helpful

You have to write /search and after the thing to search. I will now edit and make it clearer.

@stupid-kid-af
Copy link

Can you please link the bot source code it would be very helpful

You have to write /search and after the thing to search. I will now edit and make it clearer.

Am I doing it wrong??
See in the above img

@LuigiImVector
Copy link
Member Author

Am I doing it wrong??
See in the above img

Write the thing to search in new message:
first message: /search
second message: python

@stupid-kid-af
Copy link

Am I doing it wrong??
See in the above img

Write the thing to search in new message: first message: /search second message: python
No response
Is bot open source??

@LuigiImVector
Copy link
Member Author

LuigiImVector commented Dec 19, 2021

No response

Retry and send screenshot

Is bot open source??

The repository is private for the moment because the TOKEN bot is written in plain text in the file but this is the current code: https://gist.github.com/LuigiImVector/2a82893078b7515a9b296a16ae13789c

@nbehrnd
Copy link
Contributor

nbehrnd commented Dec 19, 2021 via email

@LuigiImVector
Copy link
Member Author

I interpret (and maybe misunderstand) this as the script contains some login details (yours?). It would not be good if this were the case. Because the project for this script is written strives for free (as in open, accessible) programming, would it be acceptable for you if the source code truly would become public (i.e., going beyond the snapshot/gist shared) for code review and maybe addition of features, including addition of a permissive license (the project itself using CC BY 4.0)?

The TOKEN is the identification code of the bot that allows you to manage it, I'm working on hiding it and making the repository public. I didn't do it right away because everything was in a beta phase (still is).

Welcome if the script provides the functionality you envisioned on your local set up. (I don't use telegram). To ease the navigation in your code (for others than you), may you add brief doc strings for the functions you defined? (If it is intended to be run directly from the CLI, a shebang line, and joining the functions in a def main function plus a block like eventually calling this one would be advantageous details, too.)

The only way to run the bot in local is creating a local heroku server, I need to figure out what is the best option to make everything more opensource and maintenable by the community as well.

@nbehrnd
Copy link
Contributor

nbehrnd commented Dec 21, 2021 via email

@LuigiImVector
Copy link
Member Author

While searching for something different about Python, I stumbled over a presentation by Philip James on PyCon 2019 about setting up and interacting/moderating such a server for Mastodon with Python. Maybe it is good to have this as a spare wheel in the trunk, because (apparently) this equally may run from an instance on replit, and would be open source, too.

Do you say to create something for Mastodon too?


Anyway, I made the bot repository public: https://github.com/LuigiImVector/freeprogrammingbooks-bot
In the README there is a guide that explains how to contribute to the project, maybe there is still some imperfection in it but I'm testing and improving it.

@nbehrnd
Copy link
Contributor

nbehrnd commented Dec 21, 2021 via email

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity during last 60 days 😴

It will be closed in 30 days if no further activity occurs. To unstale this issue, remove stale label or add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale Requests that have not had recent interaction (Out-of-Date) label Sep 13, 2022
@davorpa davorpa added the keep Requests exempt from being punctually stale label Sep 13, 2022
@LuigiImVector
Copy link
Member Author

LuigiImVector commented Sep 13, 2022

The telegram bot continues to work, despite some minor fixes that need to be made. Currently:

  • Heroku (the hosting service I'm using for the bot) declared that it will no longer be free so I need to find a new host service;
  • I had started working on a 2.0 version of the bot based on free-programming-books-search (fpb.json).

If the idea of having a bot on telegram you think is still interesting I continue to work on it.

@github-actions github-actions bot removed the stale Requests that have not had recent interaction (Out-of-Date) label Sep 13, 2022
@pAkalpa
Copy link

pAkalpa commented Sep 25, 2022

@LuigiImVector Did you tried render Cloud Platform?

@LuigiImVector
Copy link
Member Author

@LuigiImVector Did you tried render Cloud Platform?

nice website but I preferred to host it on a VPS from DigitalOcean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Needs help solving a blocked / stucked item keep Requests exempt from being punctually stale New Feature New feature / enhancement / translation...
Projects
None yet
Development

No branches or pull requests

6 participants