You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Wordit <wo...@gmail.com> on 2012/09/21 04:51:29 UTC

RSS/Atom feed show/list function

Does anyone happen to have a show/list function that outputs an RSS/Atom feed?

I couldn't find any in the archives so far. Just hoping somebody
already has a code snippet lying around.

It's to help some people out hosting a literary blogfest. Thought I
could give them a form connected to a couch database for bloggers to
enter their post URLs. Then publish a feed to aggregate the posts from
all the various personal blogs.

Thanks,

Marcus

Re: RSS/Atom feed show/list function

Posted by Wordit <wo...@gmail.com>.
On Sat, Sep 29, 2012 at 6:11 PM, Ryan Ramage <ry...@gmail.com> wrote:
>Is there some sort of github viewer we can embed in the wiki? So a meta example of embedding code in the wiki.

You can embed Github gists. There's a widget, I think.

Wordpress.com has it built in. So much better than using the code
markup tag which often gets selected and copied incorrectly.

Marcus

Re: RSS/Atom feed show/list function

Posted by Ryan Ramage <ry...@gmail.com>.
I agree, we should keep up an examples/best practice section in the wiki...

That being said, most of what I like linking to are github snippets so
people can see code in a wider context. Is there some sort of github
viewer we can embed in the wiki? So a meta example of embedding code
in the wiki.

On Sat, Sep 29, 2012 at 8:40 AM, Noah Slater <ns...@tumbolia.org> wrote:
> Might it be an idea to document snippets like this on the wiki? A sort of
> show/list/view library.
>
> On Fri, Sep 21, 2012 at 3:51 AM, Wordit <wo...@gmail.com> wrote:
>
>> Does anyone happen to have a show/list function that outputs an RSS/Atom
>> feed?
>>
>> I couldn't find any in the archives so far. Just hoping somebody
>> already has a code snippet lying around.
>>
>> It's to help some people out hosting a literary blogfest. Thought I
>> could give them a form connected to a couch database for bloggers to
>> enter their post URLs. Then publish a feed to aggregate the posts from
>> all the various personal blogs.
>>
>> Thanks,
>>
>> Marcus
>>
>
>
>
> --
> NS

Re: RSS/Atom feed show/list function

Posted by Noah Slater <ns...@tumbolia.org>.
Might it be an idea to document snippets like this on the wiki? A sort of
show/list/view library.

On Fri, Sep 21, 2012 at 3:51 AM, Wordit <wo...@gmail.com> wrote:

> Does anyone happen to have a show/list function that outputs an RSS/Atom
> feed?
>
> I couldn't find any in the archives so far. Just hoping somebody
> already has a code snippet lying around.
>
> It's to help some people out hosting a literary blogfest. Thought I
> could give them a form connected to a couch database for bloggers to
> enter their post URLs. Then publish a feed to aggregate the posts from
> all the various personal blogs.
>
> Thanks,
>
> Marcus
>



-- 
NS

Re: RSS/Atom feed show/list function

Posted by Wordit <wo...@gmail.com>.
Thanks Benoit, looks handy. Only Jens has a point. I get this browser error:

error on line 28 at column 22: Entity 'icirc' not defined

Marcus

Re: RSS/Atom feed show/list function

Posted by Jens Alfke <je...@couchbase.com>.
On Sep 21, 2012, at 9:55 AM, Benoit Chesneau <bc...@gmail.com>> wrote:

well it just works for our usage:

http://refuge.io/blog

Mustache by itself doesn't escape it so i's good I guess. Date are
provided usig the iso format.

It doesn’t pass the W3C validator: http://validator.w3.org/appc/check.cgi?url=http%3A%2F%2Frefuge.io%2Fblog%2Frss

I realize this is going off-topic; just replying to the list to let the OP know that this code doesn’t generate valid feeds. Further RSS/Atom minutae should be off-list :)

—Jens

Re: RSS/Atom feed show/list function

Posted by Benoit Chesneau <bc...@gmail.com>.
On Fri, Sep 21, 2012 at 6:26 PM, Jens Alfke <je...@couchbase.com> wrote:
>
> On Sep 20, 2012, at 11:53 PM, Benoit Chesneau <bc...@gmail.com> wrote:
>
>> https://github.com/refuge/refuge.blog/blob/master/lists/rss_feed.js
>
> Two potential issues with this, from quick inspection:
>
> (1) The date is emitted from the template just using "<pubDate>{{created_at}}</pubDate>”. It’s not clear whether the created_at field has the correct date format for RSS 2.0.
>
> (2) The XML is generated by calling Mustache.to_html. Does Mustache realize it’s generating XML not HTML? Otherwise it might for instance generate HTML escapes (like "&eacute;") that aren’t defined in raw XML.
>
> —Jens

well it just works for our usage:

http://refuge.io/blog

Mustache by itself doesn't escape it so i's good I guess. Date are
provided usig the iso format.

- benoît

Re: RSS/Atom feed show/list function

Posted by Jens Alfke <je...@couchbase.com>.
On Sep 20, 2012, at 11:53 PM, Benoit Chesneau <bc...@gmail.com> wrote:

> https://github.com/refuge/refuge.blog/blob/master/lists/rss_feed.js

Two potential issues with this, from quick inspection:

(1) The date is emitted from the template just using "<pubDate>{{created_at}}</pubDate>”. It’s not clear whether the created_at field has the correct date format for RSS 2.0.

(2) The XML is generated by calling Mustache.to_html. Does Mustache realize it’s generating XML not HTML? Otherwise it might for instance generate HTML escapes (like "&eacute;") that aren’t defined in raw XML.

—Jens

Re: RSS/Atom feed show/list function

Posted by Benoit Chesneau <bc...@gmail.com>.
On Fri, Sep 21, 2012 at 4:51 AM, Wordit <wo...@gmail.com> wrote:
> Does anyone happen to have a show/list function that outputs an RSS/Atom feed?
>
> I couldn't find any in the archives so far. Just hoping somebody
> already has a code snippet lying around.
>
> It's to help some people out hosting a literary blogfest. Thought I
> could give them a form connected to a couch database for bloggers to
> enter their post URLs. Then publish a feed to aggregate the posts from
> all the various personal blogs.
>
> Thanks,
>
> Marcus

https://github.com/refuge/refuge.blog/blob/master/lists/rss_feed.js

- benoît

Re: RSS/Atom feed show/list function

Posted by Benjamin Young <by...@bigbluehat.com>.
On 9/20/2012 11:16 PM, Jens Alfke wrote:
> On Sep 20, 2012, at 7:51 PM, Wordit <wo...@gmail.com> wrote:
>
>> Does anyone happen to have a show/list function that outputs an RSS/Atom feed?
>> I couldn't find any in the archives so far. Just hoping somebody
>> already has a code snippet lying around.
> I don’t have an answer, but if you find or write one, please test it with the W3C Feed Validator:
> 	http://validator.w3.org/appc/
>
> In a past life I wrote a news-reader client, and the number of invalid RSS feeds we found in the wild was astounding. It made my job a lot more painful to have to deal with tag soup, screwy date formats, broken metacharacter escaping, etc. etc.

If you feel like trying your hand at building/extending another 
news-reader client, Dale Harvey's Settee would be a good place to start:
https://github.com/daleharvey/settee

>
> —Jens


Re: RSS/Atom feed show/list function

Posted by Ryan Ramage <ry...@gmail.com>.
Max Ogden's monocles app has an atom feed:

https://github.com/maxogden/monocles/blob/master/app.js#L58

R

On Thu, Sep 20, 2012 at 9:16 PM, Jens Alfke <je...@couchbase.com> wrote:
>
> On Sep 20, 2012, at 7:51 PM, Wordit <wo...@gmail.com> wrote:
>
>> Does anyone happen to have a show/list function that outputs an RSS/Atom feed?
>> I couldn't find any in the archives so far. Just hoping somebody
>> already has a code snippet lying around.
>
> I don’t have an answer, but if you find or write one, please test it with the W3C Feed Validator:
>         http://validator.w3.org/appc/
>
> In a past life I wrote a news-reader client, and the number of invalid RSS feeds we found in the wild was astounding. It made my job a lot more painful to have to deal with tag soup, screwy date formats, broken metacharacter escaping, etc. etc.
>
> —Jens

Re: RSS/Atom feed show/list function

Posted by Jens Alfke <je...@couchbase.com>.
On Sep 20, 2012, at 7:51 PM, Wordit <wo...@gmail.com> wrote:

> Does anyone happen to have a show/list function that outputs an RSS/Atom feed?
> I couldn't find any in the archives so far. Just hoping somebody
> already has a code snippet lying around.

I don’t have an answer, but if you find or write one, please test it with the W3C Feed Validator:
	http://validator.w3.org/appc/

In a past life I wrote a news-reader client, and the number of invalid RSS feeds we found in the wild was astounding. It made my job a lot more painful to have to deal with tag soup, screwy date formats, broken metacharacter escaping, etc. etc.

—Jens

Re: RSS/Atom feed show/list function

Posted by Nathan Vander Wilt <na...@calftrail.com>.
Late to the party but for the records I've got one that passes http://validator.w3.org/appc/ validation as used on http://n.exts.ch:
https://github.com/natevw/Glob/blob/master/lists/posts.js#L67
https://github.com/natevw/Glob/blob/master/lib/atom.js

Atom generation was derived from this file in jchris's Sofa blog example:
https://github.com/jchris/sofa/blob/master/vendor/couchapp/lib/atom.js

It uses e4x so it looks a little crazy but works fine in CouchDB's SpiderMonkey and should avoid "handwritten" XML pitfalls.

hth,
-natevw

On Sep 20, 2012, at 7:51 PM, Wordit wrote:

> Does anyone happen to have a show/list function that outputs an RSS/Atom feed?
> 
> I couldn't find any in the archives so far. Just hoping somebody
> already has a code snippet lying around.
> 
> It's to help some people out hosting a literary blogfest. Thought I
> could give them a form connected to a couch database for bloggers to
> enter their post URLs. Then publish a feed to aggregate the posts from
> all the various personal blogs.
> 
> Thanks,
> 
> Marcus