1
0
Fork
You've already forked teletekst
0
  • Python 99.6%
  • Makefile 0.4%
2025年08月09日 23:30:45 +02:00
.github/workflows Multiple changes around the custom diff code 2025年08月09日 13:44:16 -07:00
tests Multiple changes around the custom diff code 2025年08月09日 13:44:16 -07:00
.gitignore Ignore __pycache__/ 2025年07月19日 14:21:32 -07:00
compare_pages.py Multiple changes around the custom diff code 2025年08月09日 13:44:16 -07:00
customdiff.py Multiple changes around the custom diff code 2025年08月09日 13:44:16 -07:00
Makefile Multiple changes around the custom diff code 2025年08月09日 13:44:16 -07:00
README.org Initial commit with README file 2024年07月20日 12:05:02 -07:00
teletekst.css Avoid external CSS; work around buggy "next page" references 2025年07月19日 14:31:05 -07:00
walk_pages.py 99% of the time, the first page after 10[1-3] is 104. But not always. 2024年08月03日 18:14:01 -07:00

Teletekst Bot Source Code

walk_pages.py

  • Check the three index pages (101, 102, 103) and determine which pages are referenced from there.
  • Separately, use the next_page links from the JSON data to walk the pages 104..199.
  • Also fetch information for any of the pages referenced on the index pages outside of 104..199, which happens from time to time for sport related news.
  • Save that data to disk and, if asked to, compare with the most recent set, then discard if nothing changed.

compare_pages.py

  • For each of the pages in the old set, look for a match in the new set, with a (very simple, at this time) heuristic that compares the sets of words on the old and new pages to allow for the possibility that sentences were tweaked or rearranged.
  • Anything that is left afterward, is assumed to be a new page.
  • For the matching pages, check if they're completely identical or that some aspect changed. The page number, the title, or the content. Do whatever needs to be done depending on that.