Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.
/ GrindrPlus Public archive

Fetch News from Telegram and dump to a json #11770

Fetch News from Telegram and dump to a json

Fetch News from Telegram and dump to a json #11770

Workflow file for this run

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