yogthos/clj-rss

Attributes to items

Aberta

#23 aberto em 20 de out. de 2021

 (2 comentários) (0 reação) (0 responsável)Clojure (15 forks)github user discovery
enhancementhelp wanted

Métricas do repositório

Stars
 (68 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

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"}))))

Guia do colaborador