I'm trying to modify reader.lua code, part of Enigma, to support Toodledo RSS [to-do list].
First, here's what the feed look like:
Code: Select all
<title>Toodledo :: to-do list</title>
<link>http://www.toodledo.com/</link>
<description>Your to-do list </description>
<lastBuildDate>Fri, 06 Jan 2012 00:00:01 GMT</lastBuildDate>
<language>en-us</language>
<ttl>300</ttl>
<item>
<title>some task #1</title>
<link>http://www.toodledo.com/tasks/...</link>
<guid>http://www.toodledo.com/tasks/...</guid>
<pubDate>Fri, 06 Jan 2012 00:00:01 GMT</pubDate>
<description><![CDATA[ Due Date: By Jan 05<br /> Repeat: Every 1 month<br /> Priority: Top<br /> ]]></description>
</item>
<item>
<title>some task #2</title>
<link>http://www.toodledo.com/tasks/...</link>
<guid>http://www.toodledo.com/tasks/...</guid>
<pubDate>Fri, 06 Jan 2012 00:00:01 GMT</pubDate>
<description><![CDATA[ Due Date: By Jan 06<br /> Priority: High<br /> ]]></description>
</item>
I would like to extract the due date, right after Due By:... in the description node.
So I added the following code to Reader.lua
Code: Select all
elseif string.match(sRaw, '<title>Toodledo') then
sRawCounted, iNumberOfItems = string.gsub(sRaw, '<item', "")
sPatternFeedLink = '.-<link.->(.-)</link>'
sPatternItem = '<item.-</item>'
sPatternItemLink = '.-<link.->(.-)</link>'
sPatternItemDesc = '.-<description.->(.-)</description>'
sPatternItemDate = '.-<description.->.*Due Date: By(.-)<br.*</description>'
Am I right to think the issue is with the RegEx expression, or am I missing something out? Shouldn't sPatternItemDate = '.-<description.->.*Due Date: By(.-)<br.*</description>' cover it right?
Thanks a lot, I hope I explained it correctly.