diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2023-11-03 17:25:38 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2023-11-03 17:25:38 +0100 |
| commit | afad33e23be8f0a73bd2d1e12798cc50e21e5895 (patch) | |
| tree | ce1272cc3056f9d0cc58520ef5582f317c0dbb22 /bin | |
| parent | f0c7fbb587edf352aa47a3139325b8b46bba07d2 (diff) | |
| download | mitjafelicijan.com-afad33e23be8f0a73bd2d1e12798cc50e21e5895.tar.gz | |
Updated webring script
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/webring.rb | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/bin/webring.rb b/bin/webring.rb index 29b0128..066d66b 100644 --- a/bin/webring.rb +++ b/bin/webring.rb | |||
| @@ -6,15 +6,15 @@ require "simple-rss" | |||
| 6 | summary_max_length = 320 | 6 | summary_max_length = 320 |
| 7 | 7 | ||
| 8 | feeds = [ | 8 | feeds = [ |
| 9 | "https://landley.net/rss.xml", | 9 | "https://landley.net/rss.xml", |
| 10 | "https://drewdevault.com/feed.xml", | 10 | "https://drewdevault.com/feed.xml", |
| 11 | "https://offbeatpursuit.com/blog/index.rss", | 11 | "https://offbeatpursuit.com/blog/index.rss", |
| 12 | "https://mirzapandzo.com/rss.xml", | 12 | "https://mirzapandzo.com/rss.xml", |
| 13 | "https://journal.valeriansaliou.name/rss/", | 13 | "https://journal.valeriansaliou.name/rss/", |
| 14 | "https://neil.computer/rss/", | 14 | "https://neil.computer/rss/", |
| 15 | "https://michael.stapelberg.ch/feed.xml", | 15 | "https://michael.stapelberg.ch/feed.xml", |
| 16 | "https://utcc.utoronto.ca/~cks/space/blog/?atom", | 16 | "https://utcc.utoronto.ca/~cks/space/blog/?atom", |
| 17 | "https://szymonkaliski.com/feed.xml" | 17 | "https://szymonkaliski.com/feed.xml" |
| 18 | ] | 18 | ] |
| 19 | 19 | ||
| 20 | out_html = "" | 20 | out_html = "" |
| @@ -41,9 +41,9 @@ feeds.each do |feed_url| | |||
| 41 | 41 | ||
| 42 | summary.force_encoding("UTF-8") | 42 | summary.force_encoding("UTF-8") |
| 43 | summary = decoder.decode(summary) | 43 | summary = decoder.decode(summary) |
| 44 | .gsub(%r{</?[^>]+?>}, '') | 44 | .gsub(%r{</?[^>]+?>}, '') |
| 45 | .gsub(/\s{2,}/, ' ') | 45 | .gsub(/\s{2,}/, ' ') |
| 46 | .gsub("\n", ' ') | 46 | .gsub("\n", ' ') |
| 47 | 47 | ||
| 48 | if summary.length > summary_max_length | 48 | if summary.length > summary_max_length |
| 49 | summary = "#{summary[0...summary_max_length]}..." | 49 | summary = "#{summary[0...summary_max_length]}..." |
| @@ -73,7 +73,6 @@ feeds.each do |feed_url| | |||
| 73 | end | 73 | end |
| 74 | end | 74 | end |
| 75 | 75 | ||
| 76 | |||
| 77 | template = ERB.new <<-EOF | 76 | template = ERB.new <<-EOF |
| 78 | <h2>Posts from blogs I follow around the net</h2> | 77 | <h2>Posts from blogs I follow around the net</h2> |
| 79 | <ul><%= out_html %></ul> | 78 | <ul><%= out_html %></ul> |
