6

透過一些簡單的設定,產生 RSS 頁面的 RSS Please (rsspls)

 2 years ago
source link: https://blog.gslin.org/archives/2022/07/25/10814/%e9%80%8f%e9%81%8e%e4%b8%80%e4%ba%9b%e7%b0%a1%e5%96%ae%e7%9a%84%e8%a8%ad%e5%ae%9a%ef%bc%8c%e7%94%a2%e7%94%9f-rss-%e9%a0%81%e9%9d%a2%e7%9a%84-rss-please-rsspls/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

透過一些簡單的設定,產生 RSS 頁面的 RSS Please (rsspls)

RSS Please 是一套簡單設定 (但應該是對 programmer 簡單),可以把網頁內容轉成 RSS/Atom feed 的軟體。

我把官網上範例的註解拿掉,可以看到你需要去讀 HTML 頁面的結構,然後找出對應的 css selector:

output = "/tmp"

[[feed]]
title = "My Great RSS Feed"
filename = "wezm.rss"

[feed.config]
url = "https://www.wezm.net/"
item = "article"
heading = "h3 a"
summary = ".post-body"
date = "time"

跟我在 feedgen 上用 Python 做的事情其實差不多,他用了彈性換方便性:rsspls 可以簡單設定一些值就生出一個 feed,而我這邊的 feedgen 需要寫一段 code (雖然不長);但因為 feedgen 是用 Python 處理事情,所以可以不只可以讀 HTML 也可以讀 JSON API,另外也可以設計一些轉換邏輯 (像是 summary 的部份)。

但有人寫起來推廣總是不錯...

Related

實做 RSS/Atom feed 的最佳實踐

前陣子看到的文章,在講實做 RSS/Atom feed 的 best practice:「RSS Feed Best Practises」。 最簡單的當然還是丟個 Atom feed 就好,接下來就是一些延伸出來可以多做的事情。 首先有提到 discovery,可以讓 crawler 在抓到 HTML 頁面的時候知道 feed 在哪裡,這對於 user experience 來說蠻重要的,大多數的 feed reader 都可以透過這個方式抓到真正的 feed 位置。舉個例子來說,我丟 https://blog.gslin.org/ 進 feed reader,可以透過 discovery 的方式告訴 feed reader 我的 feed 位置在 https://blog.gslin.org/feed/:

May 17, 2022

In "Blog"

自己刻 RSS 2.0 的簡單方式

在 Lobsters Daily 上看到在介紹 RSS 2.0 的文章:「Implementing RSS for my blog (yes, this one!)」。 大多數我們都會選擇用 library 來輸出 RSS feed 或是 Atom feed,但這並不代表自己己幹 template 會很難,只要處理好 XML 的輸出就可以了。 作者分成兩塊介紹,第一塊是這個 RSS feed 是什麼,第二塊是這個 RSS feed 裡面有什麼。 第一塊的部份是描述 channel 本身的資訊,另外可以看到 {{{items}}} 這段,這是等下要放第二段的部份: title}} {{link}} {{description}} en-US pubDate}} {{{items}}} 接下來就是解釋…

July 2, 2022

In "Computer"

無名 Blog 匯出成 MT 格式

給不想看下面說明的人:備份服務的網址是 http://backup.hasname.com/blog/wretch/。 注意:這項服務還有一些小問題,有可能隨時都在改 code。 2006/10/05 20:54 更新:現在的版本會多開幾條連線平行化處理,下載的速度應該會快很多。 2006/10/05 17:30 更新:現在下載的檔名會是 backup-${username}.txt 了,這樣應該比較方便。 雖然在去年六月的時候為了幫 ashley 大姊姊 (a.k.a. 電視兒童) 從 無名 跳出來而用 Perl 寫了一個小程式,將 無名 Blog 上的文章匯出成 RSS 2.0 格式,再匯入 WordPress 裡。後來這個小程式就再加強一下,寫了一個網頁並公開出來 (參考 無名小站的 Blog 與 Album 備份及還原服務 這篇文章),並且希望 無名 提供更完整的匯出及匯入服務。 後來 養樂多 (Yam Roodo) 的 Blog 服務 提供 MT 格式 的匯出與匯入,而國外…

October 4, 2006

In "Blog"

a611ee8db44c8d03a20edf0bf5a71d80?s=49&d=identicon&r=gAuthor Gea-Suan LinPosted on July 25, 2022Categories Computer, Murmuring, Network, RSS, Software, WWWTags atom, css, feed, html, ini, please, rss, rsspls, selector, toml

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment *

Name *

Email *

Website

Notify me of follow-up comments by email.

Notify me of new posts by email.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Learn More)

Post navigation


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK