This repository was archived by the owner on May 18, 2026. It is now read-only.
Fetch News from Telegram and dump to a json #11775
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Fetch News from Telegram and dump to a json | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '*/1 * * * *' | |
| jobs: | |
| fetch-news: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Fetch updates and append to news.json | |
| run: | | |
| curl -s "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/getUpdates?offset=-20" \ | |
| | jq '[.result[] | |
| | select(.channel_post != null) | |
| | { | |
| message_id: .channel_post.message_id, | |
| text: .channel_post.text, | |
| date: .channel_post.date | |
| } | |
| | select(.text != null) | |
| ]' \ | |
| | jq -s ' | |
| (.[1] // []) as $old | |
| | (.[0] // []) as $new | |
| | ($old + $new) | |
| | unique_by(.message_id) | |
| ' - news.json > news.tmp.json | |
| mv news.tmp.json news.json | |
| - name: Commit and push if changed | |
| run: | | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add news.json | |
| git diff --cached --quiet || git commit -m "GrindrPlus: Fetch latest news from Telegram" | |
| git push |