Last active
December 25, 2015 18:39
-
-
Save silvasur/7022391 to your computer and use it in GitHub Desktop.
Fetch the latest cartoon from ruthe.de and build an Atom-Feed. You can use this with newsreaders that accept commands as a feed source (e.g. newsbeuter)
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
#!/bin/sh | |
# Released under the WTFPL (wtfpl.org). | |
URL="http://www.ruthe.de" | |
toonid=`curl -s $URL | sed -n 's/^.*archiv\.php\?.*id=\([0-9]*\).*/\1/p' | sed 1q` | |
now=`date +%Y-%m-%dT%H:%M:%SZ` | |
echo -n "<?xml version=\"1.0\" encoding=\"utf-8\"?> | |
<feed xmlns=\"http://www.w3.org/2005/Atom\"> | |
<title>Ruthe.de</title> | |
<link href=\"$URL\" /> | |
<id>$URL/</id> | |
<author> | |
<name>Ralph Ruthe</name> | |
<uri>$URL/</uri> | |
</author> | |
<updated>$now</updated> | |
<entry> | |
<title>Neuer Cartoon ($toonid)</title> | |
<id>$URL/index.php?pic=$toonid</id> | |
<updated>$now</updated> | |
<summary>Neuer Cartoon!</summary> | |
<link rel=\"alternate\" href=\"$URL/index.php?pic=$toonid\" /> | |
</entry> | |
</feed>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment