Skip to content

Commit

Permalink
Let's create an rss feed or something...
Browse files Browse the repository at this point in the history
  • Loading branch information
fixlr committed Aug 6, 2008
1 parent 84120f0 commit 229e477
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion example/just_do_it.rb
Expand Up @@ -2,5 +2,25 @@

require '../lib/nikeplus'

def generate_rss(builder, rss_title, rss_link, items)
builder.rss('version' => '0.91') {
builder.channel {
builder.title rss_title
builder.link rss_link

items.reverse.each do |item|
builder.item {
builder.title "#{item.startTime}"
builder.description "This run was #{item.miles} miles and lasted #{item.minutes}'#{item.seconds}\"."
}
end
}
}
end

# Authenticate to access your private Nike+ user info
me = NikePlus.new('my@email.com', 'secretpassword')
me = NikePlus.new('my@email.com', 'secretpassword')
my_runs = me.runs
builder = Builder::XmlMarkup.new

puts generate_rss(builder, "My Recent Runs", "http://petrock.org/runs.rss", me.runs)

0 comments on commit 229e477

Please sign in to comment.