Nice script. Chalk up more points for Ruby. ;) One thing I noticed with the import is that some timezone conversion is going on (I suppose by Xtimeline). E.g. the "WISE retreat" event is entered as March 1, 1999 in the SIMILE XML but comes out Feb 28 9pm on Xtimeline.
Also, the end times aren't transferring. I don't think RSS even has a field for that. There aren't many events in the XML with durations, so it's probably not worth reimporting using CSV. On Jun 20, 4:59 pm, Stephen Bannasch <[EMAIL PROTECTED]> wrote: > I moved all the data in the sail-time project in sail-core to > > http://www.xtimeline.com/timeline/SAIL-Community > > fyi: here's the ruby script that created the rss formated content. > > require 'openssl' > OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE > require 'open-uri' > require 'hpricot' > require 'rss/maker' > > data = > Hpricot.XML(open("https://sail.svn.sourceforge.net/svnroot/sail/trunk/sail-timeline/dat...")) > deadlines = > Hpricot.XML(open("https://sail.svn.sourceforge.net/svnroot/sail/trunk/sail-timeline/dea...")) > projects = > Hpricot.XML(open("https://sail.svn.sourceforge.net/svnroot/sail/trunk/sail-timeline/pro...")) > tech = > Hpricot.XML(open("https://sail.svn.sourceforge.net/svnroot/sail/trunk/sail-timeline/tec...")) > > version = "2.0" # ["0.9", "1.0", "2.0"] > destination = "sail_timeline_rss.xml" # local file to write > > def make_rss_item(rss, element) > i = rss.items.new_item > i.title = element[:title] > i.date = Time.parse(element[:start]) > i.link = element[:link] > i.description = element.inner_html > end > > content = RSS::Maker.make(version) do |m| > m.channel.title = "Events from sail-timeline" > m.channel.link = "http://www.rubyrss.com" > m.channel.description = "Timeline data > fromhttps://sail.svn.sourceforge.net/svnroot/sail/trunk/sail-timeline" > m.items.do_sort = true # sort items by date > %w{retreat meeting}.each {|e| (data/"#{e}").each {|elem| > make_rss_item(m, elem)}} > %w{event run}.each {|e| (deadlines/"#{e}").each {|elem| > make_rss_item(m, elem)}} > %w{project}.each {|e| (projects/"#{e}").each {|elem| make_rss_item(m, > elem)}} > %w{tech}.each {|e| (tech/"#{e}").each {|elem| make_rss_item(m, elem)}} > end > > File.open(destination,"w") do |f| > f.write(content) > end --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SAIL-Dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/SAIL-Dev?hl=en -~----------~----~----~----~------~----~------~--~---
