document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #!/bin/bash
  2. #FU RSS
  3. #Carlos Sepulveda, casep@fedoraproject.org
  4. #20130628, Casep, Initial Release
  5. #Requires links installed
  6. #Assumes the image is something like
  7. #http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/100000/80000/8000/700/188736/188736.strip.gif
  8. #somewhere in the html code
  9.  
  10.  
  11. today=$(date +%F)
  12. folder=$1
  13. #magic here, change if needed
  14. image=$(links -source http://dilbert.com/strips/comic/$today | grep "img src" |  grep "strip.gif" | cut -d "<" -f4 | cut -d"\\"" -f2)
  15. echo "<item><title>$today</title><description><![CDATA[<html><head><title>Dilbert for $today</title></head><body><img src=\\"$image\\"></body></html>]]></description><link>http://dilbert.com/strips/comic/$today</link></item>" > $folder/dilbert_$today
  16. echo "<?xml version=\\"1.0\\"?><rss version=\\"2.0\\"><channel><title>Yet another Dilbert feed</title><description>FU new RSS feed</description><link>http://dilbert.com</link>" > $folder/feed.xml
  17. cat $folder/dilbert_* >> $folder/feed.xml
  18. echo "</channel></rss>" >> $folder/feed.xml
');