瀏覽代碼

Update with Plaque Guide info

master
Adrian Short 11 年之前
父節點
當前提交
06b1026fd8
共有 1 個文件被更改,包括 6 次插入5 次删除
  1. +6
    -5
      csv2georss.rb

+ 6
- 5
csv2georss.rb 查看文件

@@ -3,12 +3,13 @@ require 'pp'
require 'erb' require 'erb'
require 'time' require 'time'


# https://gist.github.com/adrianshort/5547284
# $ ruby csv2georss.rb myfile.csv > feed.xml # $ ruby csv2georss.rb myfile.csv > feed.xml


template = ERB.new <<-EOF template = ERB.new <<-EOF
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"> <rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<channel>
<channel>
<title><%= channel[:title] %></title> <title><%= channel[:title] %></title>
<link><%= channel[:link] %></link> <link><%= channel[:link] %></link>
<description><%= channel[:description] %></description> <description><%= channel[:description] %></description>
@@ -30,9 +31,9 @@ template = ERB.new <<-EOF
EOF EOF
channel = { channel = {
:title => "Open Plaques",
:link => "http://openplaques.org/",
:description => "Documenting the historical links between people and places, as recorded by commemorative plaques."
:title => "Plaque Guide",
:link => "http://www.plaqueguide.com/",
:description => ""
} }


items = [] items = []
@@ -50,7 +51,7 @@ CSV.foreach(ARGV[0]) do |row|
:link => link, :link => link,
:description => row[32], # note1 :description => row[32], # note1
:pubDate => Time.now.rfc822, :pubDate => Time.now.rfc822,
:author => "feedback@openplaques.org",
:author => "info@plaqueguide.com",
:guid => link, :guid => link,
:lat => row[5], :lat => row[5],
:long => row[6] :long => row[6]


Loading…
取消
儲存