ton-society / grants-and-bounties

TON Foundation invites talent to imagine and realize projects that have the potential to integrate with the daily lives of users.
https://ton.org/grants
295 stars 133 forks source link

Haktoberfest issues parser #314

Closed aSpite closed 1 year ago

aSpite commented 1 year ago

Summary

Creating a parser that collects issues related to Hacktoberfest, compiles them into a list, and sends them to specified Telegram chats and Discord channels.

Context

In the near future, Hacktoberfest is planned. Alongside it, Hacktonberfest will be launched. When sending new issues, 2 issues from TON (8 + 2 = 10 in total) could be added to them. This way, it would be possible to generate interest in these issues, highlighting them, and attracting them to TON.

Goals

Selection Criteria: Compiling a list of criteria for selecting repositories is necessary. This means that the repositories should be up-to-date to ensure the selected issues are not irrelevant. Parsing: Parsing issues from various GitHub repositories selected based on predefined criteria should be ensured. Flexible Configuration: All criteria, chat lists, channels, and so on, should be configurable through a Telegram bot. Logging: All errors, successful distributions, and the like should be sent to a designated chat.

Additional Functionality:

  1. Ability to initiate parsing with a command in the Telegram bot to generate text for distribution.
  2. A command to retrieve the current channels for distribution.

Deliverables

A service that parses valuable issues related to Hacktoberfest and Hacktonberfest, sends them to Telegram chats, and specified Discord channels. It also features flexible configuration options and logging.

Definition of Done

Reward

Oriental Release Date

1 week

novusnota commented 1 year ago

If this is going to get approved, I'd like to make it :)

Couple of questions though:

  1. All of the config is done via a Telegram bot, meaning that it would take care of Discord channels too?
  2. Both Telegram and Discord send events whenever the bot status in groups/channels or servers respectively, so there's no need to specify the targets — bot can simply post anywhere it has access to.
  3. About issues — should bot track only those with hacktoberfest tag? Because it's often common that the whole repository has this tag, while many issues do not.
aSpite commented 1 year ago

@novusnota , actually, I was planning to do it

novusnota commented 1 year ago

@aSpite ok, sure thing

delovoyhomie commented 1 year ago

@alefmanvladimir, this bounty is useful to you in organizing hack-ton-berfest. Please let me know here if there is something to add or just confirm that everything is OK.

alefmanvladimir commented 1 year ago

Everything is clear, you can start development @aSpite 👍

aSpite commented 1 year ago

The bot is ready: repo.

Currently, the parser searches for repositories created before 2021 with more than 1000 stars. Additionally, the issue must have been created no earlier than July 2023.

Bot functionality:

Commands:

/config - shows the current configuration. /tg_groups - shows the Telegram groups where the broadcast is sent. /discord_channels - shows the Discord channels where the broadcast is sent. /parse - manually triggers the parser and retrieves messages for manual broadcasting. /admins - displays the list of administrators.

Config fields:

Field name Description
Star criteria The minimum number of stars for a repository to be considered.
Created criteria The minimum date for a repository to be considered.
Issue created criteria The minimum date for an issue to be considered.
Issue per repo The maximum number of issues per repository to be considered.
Hours to send The number of hours when the service will parse and send messages.
Service chat ID The ID of the chat where the bot will send notifications and logs.
Overall topic Topic label for Hacktoberfest.
TON Topic Topic label for Hack-TON-berfest.

How to use

To use this in the root folder, you need to create a .env file with the following contents:

Field name Description
GTIHUB_API_TOKEN You need to create a fine-grained token. No permissions need to be granted; it's used solely for interacting with GitHub search. Instructions.
TELEGRAM_BOT_TOKEN This is the bot token obtained from BotFather.
DISCORD_SELF_TOKEN You should specify the token for your Discord account (not a bot on Discord). Be extremely cautious as it grants access to your entire account; I recommend using a new account for this purpose.

Also, there is ADMIN_ID field in the config file inside the project. You should specify your Telegram ID there. This is for creating the first admin.

Some screenshots

Screenshots

Wallet: aspite.t.me

delovoyhomie commented 1 year ago

@aSpite, cool! Please text the full wallet address, not the domain, because the domain can be transferred and the owner's address will change.

aSpite commented 1 year ago

@delovoyhomie

EQDKbjIcfM6ezt8KjKJJLshZJJSqX7XOA4ff-W72r5gqPrHF

alefmanvladimir commented 1 year ago

@aSpite Good job! Thank you for the quick realization👍

delovoyhomie commented 1 year ago

Rewards sent! Thank you for the contribution.

Questbook proposal