yogthos/clj-rss

Attributes to items

Open

#23 opened on Oct 20, 2021

 (2 comments) (0 reactions) (0 assignees)Clojure (15 forks)github user discovery
enhancementhelp wanted

Repository metrics

Stars
 (68 stars)
PR merge metrics
 (PR metrics pending)

Description

I was just looking at this feed, https://hnrss.org/newest. There's an attribute to their guid tag called isPermaLink. I'd like to replicate that on my feed but it seems like the current API does not support this.

How might I go about adding this?

Example:

<item>
    <title></title>
    <description></description>
    <pubDate>Wed, 20 Oct 2021 19:47:33 +0000</pubDate>
    <link></link>
    <dc:creator>gmays</dc:creator>
    <comments>https://news.ycombinator.com/item?id=28935333</comments>
    <guid isPermaLink="false">https://news.ycombinator.com/item?id=28935333</guid>
</item>

(deftest test-attrs
  (is (= "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\"><channel><atom:link href=\"http://foo/bar\" rel=\"self\" type=\"application/rss+xml\"/><title>Foo</title><link>http://foo/bar</link><description>some channel</description><generator>clj-rss</generator><item><title>test</title><guid isPermaLink="false">http://foo/bar</guid></item></channel></rss>"
         (channel-xml {:title "Foo" :link "http://foo/bar" :description "some channel"}
                      {:title "test"
                       ;; How do we want to do this?
                       :guid "http://foo/bar"}))))

Contributor guide