lat = -1
lon = -1
ele = -1
- date = Time.now();
+ date = DateTime.now();
gotlatlon = false
gotele = false
gotdate = false
parser.listen( :characters, %w{ time } ) do |text|
if text && text != ''
- date = Time.parse(text)
+ date = DateTime.parse(text)
gotdate = true
end
end
image << link
end
- def add(latitude=0, longitude=0, title_text='dummy title', url='http://www.example.com/', description_text='dummy description', timestamp=Time.now)
+ def add(latitude=0, longitude=0, title_text='dummy title', url='http://www.example.com/', description_text='dummy description', timestamp=DateTime.now)
item = XML::Node.new 'item'
title = XML::Node.new 'title'
link << url
item << link
+ guid = XML::Node.new 'guid'
+ guid << url
+ item << guid
+
description = XML::Node.new 'description'
description << description_text
item << description
pubDate = XML::Node.new 'pubDate'
- pubDate << timestamp.xmlschema
+ pubDate << timestamp.to_s(:rfc822)
item << pubDate
if latitude
lat_el = XML::Node.new 'geo:lat'
lat_el << latitude.to_s
- item << lat_el if lat_el
+ item << lat_el
end
if longitude