

Ask PG: Link to comments in RSS - hugov

Like many of you, I read Hacker News through an RSS reader. The Hacker News RSS only has title links, no preview or link to the comments page (unless the item has no URL, like this one). To go to the comments page, you have to navigate to news.ycombinator.com, find the item you want, and click on comments. PG: can you please add a link to the comments page from the body of each RSS item. Thanks!
======
pg
There are comment links in the rss feed. Some readers show them and some
don't. If anyone can give me the exact syntax that would work in the latter,
I'll try it.

~~~
brett

      <item>
        <title>Ask PG: Link to comments in RSS</title>
        <link>http://news.ycombinator.com/item?id=112684</link>
        <comments>http://news.ycombinator.com/item?id=112684</comments>
        <description>
          &lt;a href="http://news.ycombinator.com/item?id=112684"&gt;comments&lt;/a&gt;
        </description>
      </item>

~~~
bd
Or like this:

    
    
      <item>
        <title>Ask PG: Link to comments in RSS</title>
        <link>http://news.ycombinator.com/item?id=112684</link>  
        <description><![CDATA[<a href="http://news.ycombinator.com/item?id=112684">Comments</a>]]></description>
      </item>

~~~
pg
Ok, does it work now? Here's what I'm doing:

    
    
      (def rss-stories (stories)
        (tag (rss version "2.0")
          (tag channel
            (tag title (pr this-site*))
            (tag link (pr site-url*))
            (tag description (pr site-desc*))
            (each s stories
              (tag item
                (let comurl (+ site-url* (item-url s))
                  (tag title    (pr (eschtml (s 'title))))
                  (tag link     (pr (if (blank (s 'url))
                                        comurl
                                        (eschtml (s 'url)))))
                  (tag comments (pr comurl))
                  (tag description
                    (pr "<![CDATA[")
                    (link "Comments" comurl)
                    (pr "]]>"))))))))

~~~
bd
Bloglines now shows the link twice, one from <comments> and one from
<description>.

~~~
pg
Argh. Can _anyone_ tell me a format that will work on all readers? Is the
answer to ditch the comments field?

~~~
ks
I also see them twice, but it doesn't bother me. Just leave it as it is.

------
rob
I brought this up a while ago here:
<http://news.ycombinator.com/item?id=35363>

I was using Google Reader, and there was no comments link, but have since
switched to NetNewsWire (OS X) where everything works correctly. It doesn't
look like it'll change.

~~~
silencio
That's really odd. NNW for me doesn't show links, and never has...hmm, too bad
it doesn't keep track of when I subscribe to feeds, but I'm fairly sure that's
how it's always been for me.

~~~
rob
Hmm, actually it might depend on the theme you're using. I'm using the Ollicle
Reflex theme
([http://www.ollicle.com/2006/nov/28/jquery_netnewswire_style....](http://www.ollicle.com/2006/nov/28/jquery_netnewswire_style.html))
and it displays the comments link neatly in the right column.

------
BvS
A while ago someone (sorry, forget the name) created an alternative feed which
shows a link to the comment page: <http://harumi.ath.cx/newsyc>

Works fine with Google-Reader.

------
hugov
I'm using Vienna (OS X) which as far as I can tell works perfectly for every
one of the other 200+ feeds I subscribe to - but not for Hacker News. It looks
like simply replacing the <comments> tag with a description tag containing
(only) a hyperlink to the comments page would fix the problem. Many readers
ignore the <comments> tag.

~~~
altano
Whatever's up now is working with Vienna. I see a comments link.

------
ks
I see links to comment pages for all items, so perhaps it's your RSS reader?

But it would be nice to see the submission text.

~~~
yrashk
NetNewsWire shows link to comments

------
dizz
+1 :-) I don't see links to comment pages for all items... using google reader

