RSS XML-blahfoo to liteweight JSON / HTML converter middleware
This software is probably not ready for general consumption, as it was built for a very specific purpose.
In your Express server's
app.coffee, add a request handler like this:
appget '/vouchers/:tags?'request_tags = RSSnormalize_tags requestparams 'tags' ? '' split ','url = "/feed"RSSread url### `rss` now contains all entries with *any* of the tags; next we filter out all entries that are not*not* marked with *all* of the tags specified in the request: ###rss = RSSfilter_for_tags rssrequest_tagsresponsejson rss
Here is what you could do on an HTML page to fetch the RSS and display its entries:
$ document ready ->tags = 'berlin,vodafone'$get "/vouchers/"# if status isnt 'success'vouchers =for entry in rssvoucherspush "<div class='entry'></div>"$ '#vouchers' html vouchersjoin '\n'