[SOLVED] Raw JSON (not JSON Feed) Parsing #448
-
RSS is sadly becoming more rare while JSON-based API is becoming more common. I've looked around, and I haven't yet come across a feed reader that can just read raw JSON. While this is already possible through the use of post-process scripts, being able to do it within the app would be a big improvement. jq might be a good inclusion (Creative Commons license) for parsing the retrieved JSON data. It also has a lot of documentation on creating filters to extract specific parts of JSON data that could be used to define individual articles and their contents. While this would be another form of post-process scripting, it wouldn't have to rely on an external script file. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
While browsing the rss subreddit, I saw someone mention there were some scripts that parse JSON located here. I missed this in the documentation because I was looking around for 'post-process' and not 'scrapers'. I'll be revising this issue slightly in light of this. |
Beta Was this translation helpful? Give feedback.
-
Hello @ImportTaste.
You can completely avoid 2 and have the script download data and parse it in the same time. For example from the example scrapers, you can test with one which uses NVidia JSON API to get information about latest driver releases.
This particular script is written in Python and it reads API JSON data with line Thing is you don't have to use Python to write your scripts. You can use any scripting or compiled language but Python is just quite suitable for these tasks. You can literally write everything you want, you can call "jq" inside your script to do some JSON magic. So basically.
If you are really not sure how to start, maybe provide me URL of your JSON API you want to scrape. |
Beta Was this translation helpful? Give feedback.
-
@martinrotter I'd like to thank you for the help, even if it's a few months after the fact. I've got a couple of questions.
Nevermind that second question, it was simpler than I thought. I just had to run: |
Beta Was this translation helpful? Give feedback.
Hello @ImportTaste.
You can completely avoid 2 and have the script download data and parse it in the same time.
For example from the example scrapers, you can test with one which uses NVidia JSON API to get information about latest driver releases.
stdin
to the "post-process" script.This particular script is written in Python and it reads API JSON data with line
json_data = json.loads(sys.stdin.read())
and then processes it and outputs transformed JSON FEED data which can subse…