From 94a911a576dacb8c9030c34c1d5cfb1495d2ea2d Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sat, 17 Aug 2013 09:00:27 +0100 Subject: [PATCH] Include only the most recent 100 items in the RSS feed. With the full package list, updates.rss exceeds 512kb, which upsets dlvr.it. --- html/updates.rss.erb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/html/updates.rss.erb b/html/updates.rss.erb index e4a4ec70..9db1e0f1 100644 --- a/html/updates.rss.erb +++ b/html/updates.rss.erb @@ -15,7 +15,7 @@ require 'json' require 'time' require 'ostruct' - JSON.parse(File.open("../archive.json").read).each do |pkgname, info| + packages = JSON.parse(File.open("../archive.json").read).map do |pkgname, info| versions, deps, descr, pkgtype = info version = versions.join('.') package = OpenStruct.new @@ -26,6 +26,9 @@ package.build_time = Time.new(version[0..3].to_i, version[4..5].to_i, version[6..7].to_i, hour_portion[0..1].to_i, hour_portion[2..3].to_i) package.url = "#{base_url}packages/#{pkgname}-#{version}." + (pkgtype == "single" ? "el" : "tar") package.info_url = "#{base_url}##{pkgname}" + package + end + packages.sort_by { |p| p.version }.reverse[0..200].each do |package| %> <%= package.name %> (<%= package.version %>) --- <%= ERB::Util.html_escape package.description %>