It is currently September 23rd, 2020, 3:38 pm

Reader

Discuss the use of Lua in Script measures.
dQuille
Posts: 5
Joined: April 26th, 2011, 3:10 pm

Re: Reader

Post by dQuille »

Does this script support feed merging? A use case I'm thinking of is pulling data from multiple calendar/task/todo feed sources, merging and date-sorting them into a single feed list. It would also be nice if the feed source could still be distinguishable by applying feed color coding or something to each item in the list.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 911
Joined: September 6th, 2011, 6:34 am

Re: Reader

Post by MerlinTheRed »

You can display multiple feeds at once by using the "Multiple Scripts" approach detailed in the first post. I guess you'd have to sort them by date with some other approach though.

Another thing:
Why does the RegExp have to be "(?siU)(.*)$" ? Why doesn't it work without the dollar sign? Shouldn't it just match everything then too?
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
User avatar
Kaelri
Developer
Posts: 1739
Joined: July 25th, 2009, 4:47 am

Re: Reader

Post by Kaelri »

MerlinTheRed wrote:Why does the RegExp have to be "(?siU)(.*)$" ? Why doesn't it work without the dollar sign? Shouldn't it just match everything then too?
Yeah, it probably would. I just added the "$" to be safe. (Sometimes regexes pitch a fit if they don't have anything "solid" to match.)
dQuille wrote:Does this script support feed merging? A use case I'm thinking of is pulling data from multiple calendar/task/todo feed sources, merging and date-sorting them into a single feed list. It would also be nice if the feed source could still be distinguishable by applying feed color coding or something to each item in the list.
This should be doable once I get date-parsing to work for for all formats.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 911
Joined: September 6th, 2011, 6:34 am

Re: Reader

Post by MerlinTheRed »

I think it's because of the modifiers. (?siU) means: multi-line, ignore case, ungreedy. The ungreedy option causes it to match nothing. When parsing feeds it's important because you want the immediate next occurrence of something (a tag), not the last one. In our case, only the s is important for getting the whole file, therefore (?s)(.*) will suffice.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
onimorza
Posts: 2
Joined: August 21st, 2012, 9:12 am

Re: [Proof of Concept] Universal Feed Reader

Post by onimorza »

Kaelri wrote:Set MinItems=15 on the script measure. When you show a feed with fewer than 15 items, it will fill in the rest with blank spaces. I apparently did not document this feature very well, so apologies for that.

(Also, this is a weird coincidence: I'm actually about to release a pretty major update to this script. So look for that sometime today or tomorrow.)
Thanks, that works great! :thumbup:
Will also check out the new update :great:

EDIT: working great, no errors so far, except for tooltips not showing when mouseover a topic. works in my older version, can't figure out why :/
User avatar
Kaelri
Developer
Posts: 1739
Joined: July 25th, 2009, 4:47 am

Re: [Proof of Concept] Universal Feed Reader

Post by Kaelri »

onimorza wrote:working great, no errors so far, except for tooltips not showing when mouseover a topic. works in my older version, can't figure out why :/
Can you see the variables you're trying to use in the About window? If so, then the script is working the way it should. There may be some other problem in the skin, though.
User avatar
KreAch3R
Posts: 629
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: Reader

Post by KreAch3R »

I just found a little time to check your updated script. A LOT OF new crazy stuff.
Kaelri wrote:ItemNDate: the item date. Format can be set for Google Calendar feeds. See Timestamp below.

Did you forget to include the Timestamp part, of I didn't see it somewhere? The first post is a great read, congrats!

Regarding Timestamp, is the script able to parse the Google Calendar event date? that is, when the event is due to happen?
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
User avatar
Kaelri
Developer
Posts: 1739
Joined: July 25th, 2009, 4:47 am

Re: Reader

Post by Kaelri »

KreAch3R wrote:Did you forget to include the Timestamp part, of I didn't see it somewhere?
Oops, yes. I'll add it to the main post shortly.
Regarding Timestamp, is the script able to parse the Google Calendar event date? that is, when the event is due to happen?
Yes. Right now, Google Calendar event dates are parsed, stored in the database as a UNIX timestamp, then formatted when the #ItemNDate# variable is set. Dates in all other formats are currently stored and displayed as-is.

I have made some headway on parsing dates in other formats. RSS, at least, should be relatively pain-free.
User avatar
KreAch3R
Posts: 629
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: Reader

Post by KreAch3R »

Kaelri wrote: Yes. Right now, Google Calendar event dates are parsed, stored in the database as a UNIX timestamp, then formatted when the #ItemNDate# variable is set. Dates in all other formats are currently stored and displayed as-is.

I have made some headway on parsing dates in other formats. RSS, at least, should be relatively pain-free.
Gotcha. That's what the Timestamp is about. On another note: Did I read in a post that sorting feed items by date is on your to-do list? What I mean is, take 4 different feeds and display their feed items in date order like google reader does.

P.S: I lol'ed a little on this. I could see the frustration that badly formatted feeds had caused you when you wrote it. :D
If both kinds of tags are present, and no markers are given, then I give up
because your feed is ridiculous. And if neither tag is present, then no type
can be confirmed (and there would be no usable data anyway).
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
User avatar
Kaelri
Developer
Posts: 1739
Joined: July 25th, 2009, 4:47 am

Re: Reader

Post by Kaelri »

KreAch3R wrote:On another note: Did I read in a post that sorting feed items by date is on your to-do list? What I mean is, take 4 different feeds and display their feed items in date order like google reader does.
Yes, this should be doable once I'm able to parse the dates. All of the items from each feed are stored in one big table, so it's very easy to manipulate them however you want.
KreAch3R wrote:P.S: I lol'ed a little on this. I could see the frustration that badly formatted feeds had caused you when you wrote it. :D
Yeah, that's a challenge, to say the least. One of the flaws with this approach is that DecodeCharacterReference is applied before the feed is passed to Lua, so I can't tell whether an HTML tag - like <item> or <entry> - is part of the content or the actual markup. That makes it much more difficult to reliably detect the feed format.