From 216b9f8b8b667275777a5b62123e28090a9d43c6 Mon Sep 17 00:00:00 2001 From: Gabriel RF Date: Fri, 3 Mar 2023 12:34:35 -0300 Subject: [PATCH] =?UTF-8?q?Alterado=20para=20usar=20variaveis=20do=20GitHu?= =?UTF-8?q?b=20que=20n=C3=A3o=20sejam=20secrets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cron.yml | 12 ++++++------ README.md | 8 +++++--- rss2telegram.py | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 886a2b6..fa96b63 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -31,13 +31,13 @@ jobs: - name: Run Rss to Telegram run: python rss2telegram.py env: - DESTINATION: ${{ secrets.DESTINATION }} BOT_TOKEN: ${{ secrets.BOT_TOKEN }} - URL: ${{ secrets.URL }} - EMOJIS: ${{ secrets.EMOJIS }} - MESSAGE_TEMPLATE: ${{ secrets.MESSAGE_TEMPLATE }} - BUTTON_TEXT: ${{ secrets.BUTTON_TEXT }} - PARAMETERS: ${{ secrets.PARAMETERS }} + DESTINATION: ${{ vars.DESTINATION }} + URL: ${{ vars.URL }} + EMOJIS: ${{ vars.EMOJIS }} + MESSAGE_TEMPLATE: ${{ vars.MESSAGE_TEMPLATE }} + BUTTON_TEXT: ${{ vars.BUTTON_TEXT }} + PARAMETERS: ${{ vars.PARAMETERS }} DRYRUN: ${{ steps.download.outcome }} - name: Upload history uses: actions/upload-artifact@v3 diff --git a/README.md b/README.md index 1fe50dd..50630a8 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,13 @@ Issues também são sempre bem vindas. Defina as variáveis na aba `Secrets` do repositório: -`DESTINATION`: Destinos das mensagens separados por vírgulas (`@destino` ou ID). Opcionalmente, remova a variável e crie um arquivo de nome `DESTINATION.txt` com os valores; +`BOT_TOKEN`: Token do bot que enviará as mensagens no canal ([@BotFather](https://t.me/BotFather)); -`URL`: Endereços de feeds RSS separados por vírgulas. Opcionalmente, remova a variável e crie um arquivo de nome `URL.txt` com os valores; +Defina as variáveis na aba `Variables` do repositório: -`BOT_TOKEN`: Token do bot que enviará as mensagens no canal ([@BotFather](https://t.me/BotFather)); +`DESTINATION`: Destinos das mensagens separados por vírgulas (`@destino` ou ID). Opcionalmente, remova a variável e crie um arquivo de nome `DESTINATION.txt` com os valores; + +`URL`: Endereços de feeds RSS, separados por "enter", ou seja, um por linha. Opcionalmente, remova a variável e crie um arquivo de nome `URL.txt` com os valores; `PARAMETERS`: (opcional) Parâmetros que serão adicionados ao fim do link; diff --git a/rss2telegram.py b/rss2telegram.py index a81df76..ce9c39a 100644 --- a/rss2telegram.py +++ b/rss2telegram.py @@ -163,6 +163,6 @@ def check_topics(url): pass if __name__ == "__main__": - for url in URL.split(','): + for url in URL.split(): check_topics(url)