Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate an RSS feed which can be used with dlvr.it or similar to fee…
…d updates to Twitter
- Loading branch information
Showing
3 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ | |
/archive.json | ||
/recipes.json | ||
/recipes/.dirstamp | ||
/html/updates.rss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
SHELL := /bin/bash | ||
|
||
.PHONY: all clean index.md | ||
all: index.html | ||
.PHONY: all clean index.md updates.rss | ||
all: index.html updates.rss | ||
|
||
index.md: index.erb | ||
erb index.erb > index.md | ||
|
||
index.html: index.md | ||
pandoc --template=template.html --css=style.css -s --mathml -t html --smart index.md > index.html | ||
|
||
updates.rss: updates.rss.erb | ||
erb updates.rss.erb > updates.rss | ||
|
||
clean: | ||
-rm -v index.md index.html | ||
-rm -v index.md index.html updates.rss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<rss version="2.0" | ||
xmlns:dc="http://purl.org/dc/elements/1.1/" | ||
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" | ||
xmlns:atom="http://www.w3.org/2005/Atom"> | ||
<% base_url = "http://melpa.milkbox.net/" %> | ||
<channel> | ||
<title>MELPA package updates</title> | ||
<link>http://melpa.milkbox.net</link> | ||
<atom:link href="<%= base_url %>updates.rss" rel="self" type="application/rss+xml" /> | ||
<language>en-us</language> | ||
<ttl>40</ttl> | ||
<description>News about package updates</description> | ||
<% | ||
require 'json' | ||
require 'time' | ||
require 'ostruct' | ||
JSON.parse(File.open("../archive.json").read).each do |pkgname, info| | ||
versions, deps, descr, pkgtype = info | ||
version = versions.max.to_s | ||
package = OpenStruct.new | ||
package.name = pkgname | ||
package.version = version | ||
package.build_time = Time.new(version[0..3].to_i, version[4..5].to_i, version[6..7].to_i) | ||
package.url = "#{base_url}packages/#{pkgname}-#{version}." + (pkgtype == "single" ? "el" : "tar") | ||
%> | ||
<item> | ||
<title>Package update: <%= package.name %> is now at version <%= package.version %></title> | ||
<description>The <%= package.name %> package in MELPA has been updated to version <%= package.version %>.</description> | ||
<pubDate><%= package.build_time.rfc822 %></pubDate> | ||
<guid isPermaLink="true"><%= package.url %></guid> | ||
<link><%= package.url %></link> | ||
</item> | ||
<% end %> | ||
</channel> | ||
</rss> |