It is currently October 12th, 2024, 2:21 am

FeedReader w/ sorting

RSS, ATOM and other feeds, GMail, Stocks, any information retrieved from the internet
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: FeedReader w/ sorting

Post by Kaelri »

Mordasius wrote: Fine but it just returns all Rainmeter Forums as a blank.. unless I've messed up somewhere with the paste/merge :???:

( I pasted it over Reader.lua script of EverReader 0.4 to check and same result )
No, I just noticed the same thing. It's because I pasted the script into my post, so now it's finding "<entry>" within the post content and interpreting that as an actual feed entry. (I nearly had a moment of complete loss of sanity, since it appeared in my log as though the Lua script was matching itself...) I'll try to figure out how to avoid that.

EDIT: It may simply be impossible to use "DecodeCharacterReference=1" in conjunction with this script. There is just no reasonable way to parse a feed when there's no distinction between the content and the XML.

EDIT 2: I think I can actually just recreate the DCR function within Lua and only apply it after the feed elements have been parsed. I'll let you know how it goes.
User avatar
Mordasius
Posts: 1178
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: FeedReader w/ sorting

Post by Mordasius »

I don't think it's the "DecodeCharacterReference=1" causing problems here as that was certainly working well earlier this evening and commenting it out just leaves a mess in some of the feeds.

There is also a new problem that has just appeared in the Rainmeter Forums feed:
Untitled Feeds.jpg
I'm getting the 'Untitled Feeds' in both my version and EverReader v0.4. :???:

P.S. The image also shows the difference between what you get with sorted and un-sorted feeds on the BBC news site.
You do not have the required permissions to view the files attached to this post.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: FeedReader w/ sorting

Post by Kaelri »

It's not the script that changed, it's the feed. I pasted the Lua script into my post earlier in this thread, which means that the entire script is being included in the Rainmeter Forum feed as post content. So the <entry> and </entry> strings in the script file are being parsed as entries by the script. (This can make your brain hurt if you think about it too much.)

Removing DecodeCharacterReference=1 has temporarily fixed the problem for me.
User avatar
Mordasius
Posts: 1178
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: FeedReader w/ sorting

Post by Mordasius »

Kaelri wrote:This can make your brain hurt if you think about it too much.
That's why I try not to think about stuff like that too much!
Kaelri wrote:Removing DecodeCharacterReference=1 has temporarily fixed the problem for me.
Works for me too... :)
User avatar
Mordasius
Posts: 1178
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: FeedReader w/ sorting

Post by Mordasius »

However.....

Clicking on links from the Rainmeter Forums now takes me to the first rather than the latest post in the thread...

This doesn't happen if I click on the thread title on http://rainmeter.net/forum/atom_feed.php :???:
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: FeedReader w/ sorting

Post by Kaelri »

Mordasius wrote:However.....

Clicking on links from the Rainmeter Forums now takes me to the first rather than the latest post in the thread...

This doesn't happen if I click on the thread title on http://rainmeter.net/forum/atom_feed.php :???:
Yeah, because the & isn't being decoded into & anymore. This will be accounted for when I finish replacing DCR; in the meantime, you can fix it by changing line ~219 to the following:

Code: Select all

Queue['Item'..i..'Link']    = Item.Link:gsub('&','&')   or Feed.Link or ''
User avatar
Mordasius
Posts: 1178
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: FeedReader w/ sorting

Post by Mordasius »

Kaelri wrote:Yeah, because the & isn't being decoded into & anymore. This will be accounted for when I finish replacing DCR; in the meantime, you can fix it by changing line ~219 to the following:

Code: Select all

Queue['Item'..i..'Link']    = Item.Link:gsub('&','&')   or Feed.Link or ''
Nope .. this doesn't seem to do the job but that could be because I've got mixed up with what replaces what where. It could be because I've been including stuff to sort the feeds but I've put nothing new that would impact on anything around line 219.

Please post the complete version of your revised lua script so I can take it from there. Tnx :)
rainusero
Posts: 21
Joined: May 9th, 2012, 10:11 am

Re: FeedReader w/ sorting

Post by rainusero »

1.
In previous version of your script there was some "feature" which isn't present at this new version of LUA script:

I used MiddleMouseUPAction=!Refresh (Middle Mouse Button). After that refreshing, there was let's say an "shuffle" mode initiated on all feed channels. Sometimes it ended on channel 1, or 2, or 3, etc (some kind of random function called SwitchTo() in previous version of script). In this version after refresh i get implicitly channel 1 and that's it... no more shuffle.

Please switch back on this feature because it was good (at least give a user choice by implementing proper option and let him decide if he wants to "shuffle" channels by default or if he wants to have channel 1 always by default. I prefer first option/solution.

2.
Could you explain what does this part do ?
WebParserSubstitute="<![CDATA[":"","]]>":"","/PRE>":"","PRE>":"","&nbsp;":" ","'s Facebook Notifications":"","Top Stories - Google ":""

I'm curious especially this part of the line: 's Facebook Notifications":"","Top Stories - Google ":""

Why google / why Facebook ?
Could you explain it to me in a few short sentences ?

3.
What about option "NumberOfFeeds=x" which was very useful when I wanted to add to or subtract from the number of feeds displayed ?

4.
In section [MeasureLuaScript] there was an option "UpdateRate=x" when I decided how often my feeds were updated. Now i can not see it. How I can decide now how often my feed update will be performed ?
User avatar
Mordasius
Posts: 1178
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: FeedReader w/ sorting

Post by Mordasius »

rainusero wrote:1. In previous version of your script there was some "feature" which isn't present at this new version of LUA script: After refreshing, there was let's say an "shuffle" mode initiated on all feed channels. Sometimes it ended on channel 1, or 2, or 3, etc (some kind of random function called SwitchTo() in previous version of script). In this version after refresh i get implicitly channel 1 and that's it... no more shuffle.
It wasn't random, it was just switching to a particular feed each time that feed was updated. I also liked that effect and have put it back in the latest (3rd October) version on Deviant Art.
rainusero wrote:2. Could you explain what does this part do ? WebParserSubstitute="<![CDATA[":"","]]>":"","/PRE>":"","PRE>":"","&nbsp;":" ","'s Facebook Notifications":"","Top Stories - Google ":""
Check the explanation for Substitute in the manual. It is used to change text strings and in this case it is saying if you find "Facebook Notifications" or "Top Stories - Google " in the feed, replace it with a blank "". I don't know why these particular strings need to be removed but they are of no interest when it comes to displaying feed items.
rainusero wrote:3. What about option "NumberOfFeeds=x" which was very useful when I wanted to add to or subtract from the number of feeds displayed ?
"NumberOfFeeds=x" isn't needed with the latest version of the Reader script. You just add a copy of [MeasureFeed] as [MeasureFeed6] in the measures section and then add the new MeasureName in [MeasureReader]

Code: Select all

MeasureName=MeasureFeed|MeasureFeed2|MeasureFeed3|MeasureFeed4|MeasureFeed5|MeasureFeed6
You'll also have to add [Grabber6State] and [Grabber6] with the numbers changed to 6.
rainusero wrote:4. In section [MeasureLuaScript] there was an option "UpdateRate=x" when I decided how often my feeds were updated. Now i can not see it. How I can decide now how often my feed update will be performed ?
You change the UpdateRate for each feed in the [Variables] section:

Code: Select all

[Variables]
;-> put the URL's for news feeds here along with the update rate for each feed. (UpdateRate=1800 = update every 30 minutes).  
URL1=http://feeds.bbci.co.uk/news/rss.xml?edition=uk
UpdateRate1=1800
@Kaleri: The script seems to be behaving itself today with DecodeCharacterReference=1 commented out. I did have to add &, ", &apos;, > and < to #WebParserSubstitute# as they were popping up here and there in the feeds and titles.
rainusero
Posts: 21
Joined: May 9th, 2012, 10:11 am

Re: FeedReader w/ sorting

Post by rainusero »

1.
Switching to a particular feed each time that feed was updated works fine, but too fast, IMHO.
Is this feature customizable ? Can it be customizable (switching speed/refresh -> that should be a little bit slowly like in previous version) ?

2.
What about feeds with less than 10 items - when you switch from feed where there is 10 items to another feed where is less than 10 items,
there is some problem with refresh. I see e.g. 5 items from current set of feeds and another 5 items from recently readed feeds when I switch to another one.
There should be visible only 5 current items instead of 10.

Some examples below (I changed MinItems=10 to MinItems=1 in [MeasureReader] section).

http://feeds.feedburner.com/LinuxAdminZone
http://www.linuxforums.org/forum/external.php?type=RSS2&forumids=17
http://www.linuxforums.org/forum/external.php?type=RSS2&forumids=24
http://www.linuxforums.org/forum/external.php?type=RSS2&forumids=35
http://www.linuxforums.org/forum/external.php?type=RSS2&forumids=54
http://www.unix.com/external.php?forumids=129
http://phoronix.com/forums/external.php?type=RSS2&forumids=52
http://phoronix.com/forums/external.php?type=RSS2&forumids=14

3.
Check below feeds:

http://gagor.pl/feed/
http://www.linuxforu.com/feed/

With this substitute option:

WebParserSubstitute="<![CDATA[":"","]]>":"","/PRE>":"","PRE>":"","&nbsp;":" ","'s Facebook Notifications":"","Top Stories - Google ":"","&":"&",""":'"',">":">","<":"<","&apos;":"'"

it doesn't work properly with feeds I mentioned above. Could you check it and fix it ?

4.
When there is none URL given
(like this
URL1=
UpdateRate1=1800) I always see message: Loading... Waiting for data from WebParser.

It's ok but...

a)
after let's say 3-5 seconds when there's something wrong with RSS this message should be changed to e.g. "No valid feed found - check config."
or "Unable to find valid URL - chech config." or something else.

b)
Message "Matching Error - connection problem" or similar one should be displayed in every case when there's connection problem with particular RSS
(remote site doesn't work). That should be good enough.

Try to figure out something with section a) and/or b) :)