From d88480818722292393ea0922f03ea32bcdcbc4e8 Mon Sep 17 00:00:00 2001 From: neingeist Date: Fri, 13 Oct 2006 18:03:56 +0000 Subject: [PATCH] Put templates in extra file --- neinomat-radio-chaotica | 75 +--------------------------- neinomat-radio-chaotica.templates.rb | 73 +++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 73 deletions(-) create mode 100755 neinomat-radio-chaotica.templates.rb diff --git a/neinomat-radio-chaotica b/neinomat-radio-chaotica index cae285a..d552ac3 100755 --- a/neinomat-radio-chaotica +++ b/neinomat-radio-chaotica @@ -10,79 +10,7 @@ require 'net/http' # Constants RFC822 = "%a, %d %b %Y %T %z" # for Date::strftime -TPL_RSS = ' - - - -radio chaotica podcast -http://entropia.de/wiki/Radio%20Chaotica -ein podcast der sendungen des entropia e.v., chaos computer club karlsruhe auf querfunk, 104.8 mhz -Talk Radio -MediaWiki neinomat -de -Entropia e.V. Karlsruhe - -radio@entropia.de (Radio Chaotica) -<%=Time.now.strftime(RFC822) %> - - http://podcast.entropia.de/chaotica-100x300-crappy.png - 100 - 300 - http://entropia.de/wiki/Radio%20Chaotica - Radio Chaotica - - -daily -1 -2000-01-01T12:00+00:00 - -ein podcast der sendungen des entropia e.v., chaos computer club karlsruhe auf querfunk, 104.8 mhz - -ein podcast der sendungen des entropia e.v., chaos computer club karlsruhe auf querfunk, 104.8 mhz - - - - -entropia,karlsruhe,ccc,hacking,computer,technology,society,chaosradio,chaos,politics -no - -Entropia e.V. Karlsruhe - - Entropia e.V. Karlsruhe - radio@entropia.de - - -<%= items %> - -' -TPL_ITEM = ' - - <%= CGI::escapeHTML(episode["title"]) %> - <%= episode["url"] %> - <%= CGI::escapeHTML(episode["title"]) %> - Talk Radio - " length="<%= episode["length"] %>" type="<%= episode["type"] %>" /> - - <%= episode["url"] %> - <%= episode["pubdate"] %> - <%= episode["discussion"] %> - <%= CGI::escapeHTML(episode["title"]) %> - - radio@entropia.de - - no - Entropia e.V. Karlsruhe - entropia,karlsruhe,ccc,hacking,computer,technology,society,chaosradio,chaos,politics - <%= episode["duration"] %> - <%= CGI::escapeHTML(episode["title"]) %> - <%= CGI::escapeHTML(episode["title"]) %> - -' +require "#{$0}.templates.rb" #---------------------------------------------------------------------------- # Some helper functions @@ -166,6 +94,7 @@ episodes = [] $stderr.puts "DEBUG: Only crawling one episode"; break end +# Sort episodes, starting with last episodes = episodes.sort do |x,y| y["date"] <=> x["date"] end diff --git a/neinomat-radio-chaotica.templates.rb b/neinomat-radio-chaotica.templates.rb new file mode 100755 index 0000000..1178fe6 --- /dev/null +++ b/neinomat-radio-chaotica.templates.rb @@ -0,0 +1,73 @@ +TPL_RSS = ' + + + +radio chaotica podcast +http://entropia.de/wiki/Radio%20Chaotica +ein podcast der sendungen des entropia e.v., chaos computer club karlsruhe auf querfunk, 104.8 mhz +Talk Radio +MediaWiki neinomat +de +Entropia e.V. Karlsruhe + +radio@entropia.de (Radio Chaotica) +<%=Time.now.strftime(RFC822) %> + + http://podcast.entropia.de/chaotica-100x300-crappy.png + 100 + 300 + http://entropia.de/wiki/Radio%20Chaotica + Radio Chaotica + + +daily +1 +2000-01-01T12:00+00:00 + +ein podcast der sendungen des entropia e.v., chaos computer club karlsruhe auf querfunk, 104.8 mhz + +ein podcast der sendungen des entropia e.v., chaos computer club karlsruhe auf querfunk, 104.8 mhz + + + + +entropia,karlsruhe,ccc,hacking,computer,technology,society,chaosradio,chaos,politics +no + +Entropia e.V. Karlsruhe + + Entropia e.V. Karlsruhe + radio@entropia.de + + +<%= items %> + +' +TPL_ITEM = ' + + <%= CGI::escapeHTML(episode["title"]) %> + <%= episode["url"] %> + <%= CGI::escapeHTML(episode["title"]) %> + Talk Radio + " length="<%= episode["length"] %>" type="<%= episode["type"] %>" /> + + <%= episode["url"] %> + <%= episode["pubdate"] %> + <%= episode["discussion"] %> + <%= CGI::escapeHTML(episode["title"]) %> + + radio@entropia.de + + no + Entropia e.V. Karlsruhe + entropia,karlsruhe,ccc,hacking,computer,technology,society,chaosradio,chaos,politics + <%= episode["duration"] %> + <%= CGI::escapeHTML(episode["title"]) %> + <%= CGI::escapeHTML(episode["title"]) %> + +'