You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if this post would be better as an issue or a discussion but since you can make an issue from a discussion I've chosen to post here in discussions.
I've recently needed to use the post-processing script option as I wanted to add some GitHub releases as a feed and the JSON data the GH API outputs needs post-processing to be JSON Feed compliant. I modified the github-releases.py file from the scrapers folder on the RSS Guard GitHub by using the argparse python module for argument parsing (my modified github-releases.py file can be found at this Gist). I tested my modified github-releases.py with the following command on both PowerShell 7 and the normal Windows Command Prompt:
The output is as follows on both PowerShell and Windows Command Prompt (screenshots for PS7 and CMD) (the RegEx in the screenshot is printed as stderr and is there to confirm that the string in python is correct):
This looks like JSON Feed complaint JSON to me, so I added a script with the following parameters in advanced mode (screenshot) and tried to fetch the feed but it doesn't add any articles to the feed. However, if I remove the quotes in the command and escape the carat for the regex (py ..\resources\scripts\scrapers\github-releases.py -R "^[\d\.-]+$" → py ..\resources\scripts\scrapers\github-releases.py -R ^^[\d\.-]+$) it now does fetch the articles.
I'd like to know if anyone can tell me if there's something wrong with how my modified github-releases.py interacts with RSS Guard, as I don't understand why py ..\resources\scripts\scrapers\github-releases.py -R "^[\d\.-]+$" doesn't work but py ..\resources\scripts\scrapers\github-releases.py -R ^^[\d\.-]+$ does. And if I'm missing something that's really simple, I'd like it if someone could tell me what I'm missing here.
My system information (from the Copy info to clipboard button in RSS Guard about, with Python info added): Version: 4.7.0 (built on Windows/AMD64) Revision:f2d3203 Build date: 14/05/2024 00:50 OS: Windows 10 Version 22H2 Qt: 6.6.3 (compiled against 6.6.3) Python: 3.12
EDIT
After making this post I've realised that RSS Guard generates debug logs for every feed fetch. I have since:
Deleted and re-added the JSON feed with py ..\resources\scripts\scrapers\github-releases.py -R "^[\d\.-]+$"
Fetched the feed
Copied the debug log contents starting from the fetch to the attached text file rssg-pps-quotes-log.txt
Changed the post-processing script command to py ..\resources\scripts\scrapers\github-releases.py -R ^^[\d\.-]+$
Fetched the feed
Copied the debug log contents starting from the fetch to the attached text file rssg-pps-escape-log.txt
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I don't know if this post would be better as an issue or a discussion but since you can make an issue from a discussion I've chosen to post here in discussions.
I've recently needed to use the post-processing script option as I wanted to add some GitHub releases as a feed and the JSON data the GH API outputs needs post-processing to be JSON Feed compliant. I modified the
github-releases.py
file from the scrapers folder on the RSS Guard GitHub by using theargparse
python module for argument parsing (my modifiedgithub-releases.py
file can be found at this Gist). I tested my modifiedgithub-releases.py
with the following command on both PowerShell 7 and the normal Windows Command Prompt:The output is as follows on both PowerShell and Windows Command Prompt (screenshots for PS7 and CMD) (the RegEx in the screenshot is printed as
stderr
and is there to confirm that the string in python is correct):This looks like JSON Feed complaint JSON to me, so I added a script with the following parameters in advanced mode (screenshot) and tried to fetch the feed but it doesn't add any articles to the feed. However, if I remove the quotes in the command and escape the carat for the regex (
py ..\resources\scripts\scrapers\github-releases.py -R "^[\d\.-]+$"
→py ..\resources\scripts\scrapers\github-releases.py -R ^^[\d\.-]+$
) it now does fetch the articles.I'd like to know if anyone can tell me if there's something wrong with how my modified
github-releases.py
interacts with RSS Guard, as I don't understand whypy ..\resources\scripts\scrapers\github-releases.py -R "^[\d\.-]+$"
doesn't work butpy ..\resources\scripts\scrapers\github-releases.py -R ^^[\d\.-]+$
does. And if I'm missing something that's really simple, I'd like it if someone could tell me what I'm missing here.My system information (from the
Copy info to clipboard
button in RSS Guard about, with Python info added):Version: 4.7.0 (built on Windows/AMD64)
Revision: f2d3203
Build date: 14/05/2024 00:50
OS: Windows 10 Version 22H2
Qt: 6.6.3 (compiled against 6.6.3)
Python: 3.12
EDIT
After making this post I've realised that RSS Guard generates debug logs for every feed fetch. I have since:
py ..\resources\scripts\scrapers\github-releases.py -R "^[\d\.-]+$"
py ..\resources\scripts\scrapers\github-releases.py -R ^^[\d\.-]+$
Beta Was this translation helpful? Give feedback.
All reactions