I followed the guides here and first created a parent measure to capture the whole feedly feed:
Code: Select all
[MeasureFeedlyFeedParser]
Measure=WebParser
Url=https://cloud.feedly.com/v3/streams/contents?streamId=user/xxxxxxxxxxxxxxxxxxxx/category/global.all
Header=Authorization: Bearer #Feedly Developer API#
RegExp=(?siU)"items":\[{(.*)}\]}\]}.*
UpdateRate=#UpdateRate#
FinishAction=[!Redraw]
Here is an example of the first feed and its structure in feedly:
Code: Select all
{"id":"user/xxxxxxxxxxxxxxxxxxxx/category/global.all",
"updated":1675980094406,
"continuation":"186096173fd:1b5c252:74502776",
"items":
[{"fingerprint":"d6b826a",
"language":"en",
"id":"zWn1Ip/2vVP5xOLcVKMo1yyOEFE5KkclvWcP+hHVlMs=_1863832bbc6:261b3dd:74502776",
"keywords":["RetroRGB"],
"originId":"https://admin.retrorgb.com/?p=39164",
"origin":
{"title":"RetroRGB",
"streamId":"feed/http://retrorgb.com/feed",
"htmlUrl":"https://www.retrorgb.com"},
"title":"GrechTech Retro Rosetta: A Multi-Player BlueRetro Adaptor",
"author":"SaturnDave (Sega Saturn, SHIRO!)",
"crawled":1675980094406,
"published":1675978490000,
"summary":
{"content":
"<a
rel=\"nofollow\"
href=\"https://www.retrorgb.com/grechtech-retro-rosetta-a-multi-player-blueretro-adaptor.html\"
title=\"GrechTech Retro Rosetta: A Multi-Player BlueRetro Adaptor\">
<img src=\"https://cdn.retrorgb.com/wp-content/uploads/2023/02/09160028/GTRR-150x150.jpg\"
width=\"150\"
alt=\"\"
class=\"webfeedsFeaturedVisual wp-post-image\"
height=\"150\">
</a>GrechTech has recently made available their new RetroRosetta, a modular Bluetooth receiver/controller
adaptor designed for retro systems with a focus on robust multi-player support and an aim to avoid
e-waste and tackle accessibility issues. The RetroRosetta supports a myriad of different game consoles
and is made possible thanks to the amazing BlueRetro project by developer […]",
"direction":"ltr"},
"alternate":
[{"type":"text/html",
"href":"https://www.retrorgb.com/grechtech-retro-rosetta-a-multi-player-blueretro-adaptor.html"}],
"visual":
{"contentType":"image/jpeg",
"url":"https://cdn.retrorgb.com/wp-content/uploads/2023/02/09160028/GTRR-150x150.jpg",
"processor":"feedly-nikon-v3.1",
"width":150,
"height":150,
"expirationDate":1678650603247,
"edgeCacheUrl":"https://lh3.googleusercontent.com/2t2djT8Pgx1XusKv7EZsd9IL2qC2-_jJc6SOLt9olXZkRAp3akMsQXYZLug- CaHl5HWQfPhTJFlLu8TRYc0r2wdlIdgJ0vFkl4WWOA"},
"canonicalUrl":"https://www.retrorgb.com/grechtech-retro-rosetta-a-multi-player-blueretro-adaptor.html",
"unread":true,
"categories":[{"id":"user/82955c76-fa63-4a3f-b56a-bcdccb9b9432/category/VIDEO GAMES","label":"VIDEO GAMES"}]}
Code: Select all
[MeasureFeedlyFeedCategory1]
Measure=WebParser
Url=[MeasureFeedlyFeedParser]
RegExp=(?siU)/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*
StringIndex=1
StringIndex2=1
[MeasureFeedlyFeedCategory2]
Measure=WebParser
Url=[MeasureFeedlyFeedParser]
RegExp=(?siU)/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*
StringIndex=1
StringIndex2=2
[MeasureFeedlyFeedCategory3]
Measure=WebParser
Url=[MeasureFeedlyFeedParser]
RegExp=(?siU)/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*/category/.*","label":"(.*)".*
StringIndex=1
StringIndex2=3
.
.
.
.
My problem now...
There are two feed elements that are not always present in all feeds (they may be omitted in some of them): the feed image and the feed author.
Here is the regex for the image:
Code: Select all
[MeasureFeedlyFeedImage1]
Measure=WebParser
Url=[MeasureFeedlyFeedParser]
RegExp=(?siU)(?(?=.*"content":).*src\=\\"(.*)\\".*(?<=}\]}))
StringIndex=1
StringIndex2=1
Download=1
[MeasureFeedlyFeedImage2]
Measure=WebParser
Url=[MeasureFeedlyFeedParser]
RegExp=(?siU)(?(?=.*"content":).*src\=\\"(.*)\\".*(?<=}\]}))(?(?=.*"content":).*src\=\\"(.*)\\".*(?<=}\]}))
StringIndex=1
StringIndex2=2
Download=1
.
.
.
.
Code: Select all
[MeasureFeedlyFeedAuthor1]
Measure=WebParser
Url=[MeasureFeedlyFeedParser]
RegExp=(?siU)(?(?=.*"origin":).*"author":"(.*)".*(?<=}\]}))
StringIndex=1
StringIndex2=1
ErrorString=-
Substitute="":"-"
[MeasureFeedlyFeedAuthor2]
Measure=WebParser
Url=[MeasureFeedlyFeedParser]
RegExp=(?siU)(?(?=.*"origin":).*"author":"(.*)".*(?<=}\]}))(?(?=.*,{").*"author":"(.*)".*(?<=}\]}))
StringIndex=1
StringIndex2=2
ErrorString=-
Substitute="":"-"
.
.
.
.
Is there a way to make a regex expression that detects when an image/author is missing in one of the feeds of the whole feedly output, and skips/leaves blank the image/author of this feed?
P.S: It's confusing I know, I'll try to explain better if someone really knows their regex