yogthos/clj-rss

Attributes to items

开放

#23 创建于 2021年10月20日

 (2 条评论) (0 个反应) (0 位负责人)Clojure (15 个派生)github user discovery
enhancementhelp wanted

仓库指标

星标
 (68 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南