MCV,
Have you given thought to including an XML Processing (Parsing, DOM, and XPath) processing library into the default install?
A number of the Services/Devices that people have asked for (Weather, Calendar, random RSS Feed data) would be trivial to write if these libs we’re included in Vera by default. It would avoid writing a ton of [overlapping] Lua code in their Device defns
There seem to be a few Lua-native, or Lua-wrapped-C implementations floating around.
Once that’s present, it would be simple to build a few lines to extract anything from a General XML feed.
eg. For Weather, you’d run the URL:
http://weather.yahooapis.com/forecastrss?p=89502
and the per-device code could reduce this using a simple (well, ok, not TOO simple) XPath Expression like:
[tt]/rss/channel/item/yweather:condition/@temp[/tt] - Extract the current Temperature
[tt]/rss/channel/item/yweather:forecast[1]/@high[/tt] - Extract today's High Temperature
[tt]/rss/channel/item/yweather:forecast[2]/@high[/tt] - Extract tomorrow's High Temperature
(my Xpath syntax might be a little off)
With the XML Lib, you could then package a simple “XML Processor” Device that, when provided with:
[ul][li]a URL[/li]
[li]a HTTP “method” - GET (default), POST, PROPFIND, or one of the many CalDAV methods[/li]
[li]an optional POST Body (for CalDAV and a few others)[/li]
[li]an XPath Expression indicating what to extract[/li][/ul]
Just a thought… been working with XPath today for work, and this seems like a natural “less code” solution for many of the problems with Web-based data (RSS, CalDAV, etc).