Article View: news.software.readers
Article #268312Re: chatbots
From: Stefan Ram
Date: Thu, 19 Feb 2026 18:06
Date: Thu, 19 Feb 2026 18:06
62 lines
4392 bytes
4392 bytes
Colin Macleod <user7@newsgrouper.org.invalid> wrote or quoted:
>Yes but many such forums (Reddit, Hacker News,...) have no way to see which
>posts are new since your last visit, which any decent usenet client will do.
>That drives me round the bend! 🤬
I read some news sources on the web. Essentially, a news source
is a list of links to news reports. I wrote a Python script
that scans those lists and creates a digest list for me, which
itself is a link list in HTML shown to me in my browser.
This digest only contains articles not shown in a previous digest,
which is implemented using a log file of all articles shown so far.
If anyone wants to build something like this himself:
Here is some pseudocode I wrote to illustrate my script, which is
much larger. That pseudocode was never executed and will still
contain errors, but is close enough to executable Python that
people with experience in Python should be able to make it run.
This approach will only work with web pages that do not require
JavaScript for access control or filling the page with content.
import re
import urllib.request
import webbrowser
# input, news source(s):
article_list = \
r"http://example.com/article_list-20260219184720-TMP-DML.html"
# output:
digest_file_name = r"output-file-20260219184720-TMP-DML.html"
log_file_name = r"log-file-20260219184720-TMP-DML.html"
# procedure:
with open( digest_file_name, "w", errors='ignore' )as digest:
request = urllib.request.Request( article_list )
resource = urllib.request.urlopen( request )
cs = resource.headers.get_content_charset()
content = resource.read().decode( cs, errors="ignore" )
# assuming each article link is in an element of type "p"
# and each p element is a link to an article:
# (This needs to be adapted to each news source!)
for p in re.finditer\
( r'''<p[^\001]*?</p>''', content, flags=re.DOTALL ):
text = p.group( 0 )
# was this already seen? check with log file:
with open(log_file_name, 'r', encoding='utf-8') as log_file:
log_file_content = log_file.read()
already_seen = text in log_file_content
if not already_seen: # <==== ### DUPES ARE SKIPPED HERE ###
# add to log file:
with open( log_file_name, 'a', encoding='utf-8') as log_file:
log_file.write(text + '\n')
# exclude unwanted topics:
if "Prince Harry" not in text:
# add to article_list
print( text, file=article_list )
webbrowser.open(digest_file_name)
Technical Details
Message-ID:
<newsreader-20260219185550@ram.dialup.fu-berlin.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!spool1.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!fu-berlin.de!uni-berlin.de!not-for-mailReferences:
<20260203.015004.573ab6e6@mixmin.net> <xn0pllnw4kzr1000@news.eternal-september.org> <10n2bkp$209ad$1@dont-email.me> <xn0pm5cfek1g64a000@news.eternal-september.org> <10n4pnj$1rsho$1@news.xmission.com> <forums-20260218180957@ram.dialup.fu-berlin.de> <1771512618-7@newsgrouper.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!spool1.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: news.software.readers
Subject: Re: chatbots
Date: 19 Feb 2026 18:06:21 GMT
Organization: Stefan Ram
Lines: 62
Expires: 1 Mar 2027 11:59:58 GMT
Message-ID: <newsreader-20260219185550@ram.dialup.fu-berlin.de>
References: <20260203.015004.573ab6e6@mixmin.net> <xn0pllnw4kzr1000@news.eternal-september.org> <10n2bkp$209ad$1@dont-email.me> <xn0pm5cfek1g64a000@news.eternal-september.org> <10n4pnj$1rsho$1@news.xmission.com> <forums-20260218180957@ram.dialup.fu-berlin.de> <1771512618-7@newsgrouper.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 28nlyt3fa0aVJDnRr80IvgL8f8vRuY40uYdp3Ct5nLqAhU
Cancel-Lock: sha1:JOWbA3AtACV8rEubyctn+P/b7n0= sha256:2LQ1kevzDKBJ7Jus2fsWqovPPfKvmNyrUHgeMNrdIQg=
X-Copyright: (C) Copyright 2026 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en