<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>db/migrate/20081013033835_add_identifier_to_trips.rb</filename>
    </added>
    <added>
      <filename>db/migrate/20081013034007_add_dopplr_ical_url_to_streams.rb</filename>
    </added>
    <added>
      <filename>db/migrate/20081013035054_add_url_to_trips.rb</filename>
    </added>
    <added>
      <filename>db/migrate/20081013035545_add_stream_id_to_trips.rb</filename>
    </added>
    <added>
      <filename>db/migrate/20081013042601_add_description_to_trips.rb</filename>
    </added>
    <added>
      <filename>public/images/services/amazon.png</filename>
    </added>
    <added>
      <filename>public/images/services/blog.png</filename>
    </added>
    <added>
      <filename>public/images/services/delicious.png</filename>
    </added>
    <added>
      <filename>public/images/services/digg.png</filename>
    </added>
    <added>
      <filename>public/images/services/dopplr.png</filename>
    </added>
    <added>
      <filename>public/images/services/flickr.png</filename>
    </added>
    <added>
      <filename>public/images/services/goodreads.png</filename>
    </added>
    <added>
      <filename>public/images/services/googlereader.png</filename>
    </added>
    <added>
      <filename>public/images/services/googletalk.png</filename>
    </added>
    <added>
      <filename>public/images/services/lastfm.png</filename>
    </added>
    <added>
      <filename>public/images/services/linkedin.png</filename>
    </added>
    <added>
      <filename>public/images/services/netflix.png</filename>
    </added>
    <added>
      <filename>public/images/services/picasa.png</filename>
    </added>
    <added>
      <filename>public/images/services/slideshare.png</filename>
    </added>
    <added>
      <filename>public/images/services/stumbleupon.png</filename>
    </added>
    <added>
      <filename>public/images/services/tumblr.png</filename>
    </added>
    <added>
      <filename>public/images/services/twitter.png</filename>
    </added>
    <added>
      <filename>public/images/services/vimeo.png</filename>
    </added>
    <added>
      <filename>public/images/services/yelp.png</filename>
    </added>
    <added>
      <filename>public/images/services/youtube.png</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -33,6 +33,7 @@ sudo gem install xml-simple
 sudo gem install mechanize
 sudo gem install BlueCloth
 sudo gem install mofo
+sudo gem install icalendar
 
 == Installation
 </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -8,4 +8,8 @@ class Service &lt; ActiveRecord::Base
       self.update_attribute(:profile_image_url, twitter.profile_image_url)
     end
   end
+  
+  def icon_url
+    &quot;/images/services/#{identifier}.png&quot;
+  end
 end</diff>
      <filename>app/models/service.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,6 +21,10 @@ class Stream &lt; ActiveRecord::Base
       find(:all, options.merge(:conditions =&gt; &quot;is_enabled IS TRUE AND identifier != 'blog'&quot;))
     end
   end
+  has_many :upcoming_trips,
+    :conditions =&gt; &quot;travel_starts_at &gt; NOW()&quot;,
+    :class_name =&gt; 'Trip',
+    :limit =&gt; 8
   
   def authenticate(password)
     if self.password == password</diff>
      <filename>app/models/stream.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,2 +1,29 @@
 class Trip &lt; ActiveRecord::Base
+  
+  def self.fetch_from_dopplr
+    require 'mechanize'
+    require 'icalendar'
+    agent = WWW::Mechanize.new
+    page = agent.get(Stream.current.dopplr_ical_url.gsub(/^webcal:\/\//, 'http://'))
+    calendars = Icalendar.parse(page.body)
+    events = calendars.first.events
+    sampled_dopplr_url = nil
+    events.each do |event|
+      trip = Trip.find_or_create_by_identifier_and_stream_id(event.uid, Stream.current.id)
+      trip.update_attributes(:travel_starts_at =&gt; event.dtstart,
+                             :travel_ends_at =&gt; event.dtend,
+                             :destination =&gt; event.location,
+                             :url =&gt; event.url.to_s,
+                             :description =&gt; event.description)
+      sampled_dopplr_url ||= event.url
+    end
+    
+    if sampled_dopplr_url
+      dopplr_username = sampled_dopplr_url.to_s.match(/\/trip\/([\w]+)\//)[1]
+      dopplr_service = Service.find_or_create_by_identifier_and_stream_id('dopplr', Stream.current.id)
+      dopplr_service.update_attributes(:icon_url =&gt; '/images/services/dopplr.png',
+                                       :name =&gt; 'Dopplr',
+                                       :profile_url =&gt; &quot;http://www.dopplr.com/traveller/#{dopplr_username}&quot;)
+    end
+  end
 end</diff>
      <filename>app/models/trip.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,15 +4,16 @@
   &lt;p&gt;&lt;small&gt;Hover the labels to see description tooltip.&lt;/small&gt;&lt;/p&gt;
   &lt;% form_tag do %&gt;
     &lt;div&gt;
-      &lt;p&gt;&lt;label for=&quot;password&quot; title=&quot;Need this to get in.&quot;&gt;Password: &lt;/label&gt;&lt;%= password_field(:stream, :password) %&gt;&lt;/p&gt;
-      &lt;p&gt;&lt;label for=&quot;blog_url&quot; title=&quot;URL of this blog.&quot;&gt;Blog URL: &lt;/label&gt;&lt;%= text_field(:stream, :blog_url) %&gt;&lt;/p&gt;
-      &lt;p&gt;&lt;label for=&quot;title&quot; title=&quot;Will be used for SEO and in the title $title - $subtitle.&quot;&gt;Title: &lt;/label&gt;&lt;%= text_field(:stream, :title) %&gt;&lt;/p&gt;
-      &lt;p&gt;&lt;label for=&quot;subtitle&quot; title=&quot;Will be used for SEO and in the title $title - $subtitle.&quot;&gt;Subtitle: &lt;/label&gt;&lt;%= text_field(:stream, :subtitle) %&gt;&lt;/p&gt;
-      &lt;p&gt;&lt;label for=&quot;author&quot; title=&quot;Used for feeds and for microformats.&quot;&gt;Your name: &lt;/label&gt;&lt;%= text_field(:stream, :author) %&gt;&lt;/p&gt;
-      &lt;p&gt;&lt;label for=&quot;friendfeed_url&quot; title=&quot;Core backend of the lifestream feed must be in XML, eg: http://friendfeed.com/api/feed/user/dominiek?format=xml&quot;&gt;Friendfeed URL: &lt;/label&gt;&lt;%= text_field(:stream, :friendfeed_url) %&gt;&lt;/p&gt;
+      &lt;p&gt;&lt;label for=&quot;password&quot; class=&quot;required&quot; title=&quot;Need this to get in.&quot;&gt;Password: &lt;/label&gt;&lt;%= password_field(:stream, :password) %&gt;&lt;/p&gt;
+      &lt;p&gt;&lt;label for=&quot;blog_url&quot; class=&quot;required&quot; title=&quot;URL of this blog.&quot;&gt;Blog URL: &lt;/label&gt;&lt;%= text_field(:stream, :blog_url) %&gt;&lt;/p&gt;
+      &lt;p&gt;&lt;label for=&quot;title&quot; class=&quot;required&quot; title=&quot;Will be used for SEO and in the title $title - $subtitle.&quot;&gt;Title: &lt;/label&gt;&lt;%= text_field(:stream, :title) %&gt;&lt;/p&gt;
+      &lt;p&gt;&lt;label for=&quot;subtitle&quot; class=&quot;required&quot; title=&quot;Will be used for SEO and in the title $title - $subtitle.&quot;&gt;Subtitle: &lt;/label&gt;&lt;%= text_field(:stream, :subtitle) %&gt;&lt;/p&gt;
+      &lt;p&gt;&lt;label for=&quot;author&quot; class=&quot;required&quot; title=&quot;Used for feeds and for microformats.&quot;&gt;Your name: &lt;/label&gt;&lt;%= text_field(:stream, :author) %&gt;&lt;/p&gt;
+      &lt;p&gt;&lt;label for=&quot;friendfeed_url&quot; class=&quot;required&quot; title=&quot;Core backend of the lifestream feed must be in XML, eg: http://friendfeed.com/api/feed/user/dominiek?format=xml&quot;&gt;Friendfeed URL: &lt;/label&gt;&lt;%= text_field(:stream, :friendfeed_url) %&gt;&lt;/p&gt;
       &lt;p&gt;&lt;label for=&quot;addthis_username&quot; title=&quot;If set, will be used for voting mechanism next to digg and twitter.&quot;&gt;Addthis.com user: &lt;/label&gt;&lt;%= text_field(:stream, :addthis_username) %&gt;&lt;/p&gt;
       &lt;p&gt;&lt;label for=&quot;disqus_forum_identifier&quot; title=&quot;If set, will be used to provide commenting by Disqus.com&quot;&gt;Disqus forum identifier: &lt;/label&gt;&lt;%= text_field(:stream, :disqus_forum_identifier) %&gt;&lt;/p&gt;
-      &lt;p&gt;&lt;label for=&quot;feedburner_feed_url&quot; title=&quot;Make sure to set /articles.atom as your FeedBurner source!&quot;&gt;Feedburner Feed URL: &lt;/label&gt;&lt;%= text_field(:stream, :feedburner_feed_url) %&gt;&lt;/p&gt;
+      &lt;p&gt;&lt;label for=&quot;feedburner_feed_url&quot; title=&quot;Make sure to set /articles.atom as your FeedBurner source!&quot;&gt;Feedburner Feed URL: &lt;/label&gt;&lt;%= text_field(:stream, :feedburner_feed_url) %&gt;&lt;/p&gt;     
+      &lt;p&gt;&lt;label for=&quot;dopplr_ical_url&quot; title=&quot;The iCal address of your Dopplr.com account - used for showing your travel schedule&quot;&gt;Dopplr iCal URL: &lt;/label&gt;&lt;%= text_field(:stream, :dopplr_ical_url) %&gt;&lt;/p&gt;
     &lt;/div&gt;
     &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
     &lt;h2&gt;Stream filter&lt;/h2&gt;</diff>
      <filename>app/views/dashboard/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -42,7 +42,6 @@
     &lt;% end %&gt;
   &lt;/div&gt;
   
-  
   &lt;div class=&quot;profiles&quot;&gt;
     &lt;h3&gt;Me elsewhere&lt;/h3&gt;
     &lt;ul&gt;
@@ -54,6 +53,25 @@
     &lt;/ul&gt;
   &lt;/div&gt;
   
+  &lt;% upcoming_trips = @stream.upcoming_trips %&gt;
+  &lt;% unless upcoming_trips.blank? %&gt;
+    &lt;div class=&quot;trips&quot;&gt;
+      &lt;h3&gt;Upcoming travels&lt;/h3&gt;
+      &lt;ul&gt;
+        &lt;% upcoming_trips.each do |trip|
+          %&gt;
+          &lt;li class=&quot;trip vevent&quot;&gt;
+            &lt;span class=&quot;summary hide&quot;&gt;&lt;%= trip.destination %&gt;&lt;/span&gt;
+            &lt;%= link_to(trip.destination, trip.url, :class =&gt; 'location', :rel =&gt; 'url', :title =&gt; trip.description, :alt =&gt; trip.description) %&gt;
+            &lt;p class=&quot;description&quot;&gt;&lt;%= trip.description %&gt;&lt;/p&gt;
+            &lt;abbr class=&quot;dtstamp travel_starts_at&quot; title=&quot;&lt;%= trip.travel_starts_at.iso8601 %&gt;&quot;&gt;&lt;%= trip.travel_starts_at.strftime(&quot;%B, &quot;) + trip.travel_starts_at.strftime(&quot;%d&quot;).to_i.ordinalize.to_s %&gt;&lt;/abbr&gt;
+            &lt;abbr class=&quot;dtend travel_ends_at&quot; title=&quot;&lt;%= trip.travel_ends_at.iso8601 %&gt;&quot;&gt;&lt;/abbr&gt;
+          &lt;/li&gt;
+        &lt;% end %&gt;
+      &lt;/ul&gt;
+    &lt;/div&gt;
+  &lt;% end %&gt;
+  
   &lt;%= will_paginate(@posts) if @posts.respond_to?(:total_pages) %&gt;
 &lt;/div&gt;
 </diff>
      <filename>app/views/posts/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@
 #
 # It's strongly recommended to check this file into your version control system.
 
-ActiveRecord::Schema.define(:version =&gt; 20081011094404) do
+ActiveRecord::Schema.define(:version =&gt; 20081013042601) do
 
   create_table &quot;assets&quot;, :force =&gt; true do |t|
     t.integer  &quot;post_id&quot;
@@ -90,6 +90,7 @@ ActiveRecord::Schema.define(:version =&gt; 20081011094404) do
     t.datetime &quot;created_at&quot;
     t.datetime &quot;updated_at&quot;
     t.text     &quot;footer&quot;
+    t.string   &quot;dopplr_ical_url&quot;
   end
 
   create_table &quot;taggings&quot;, :force =&gt; true do |t|
@@ -112,6 +113,10 @@ ActiveRecord::Schema.define(:version =&gt; 20081011094404) do
     t.datetime &quot;travel_ends_at&quot;
     t.datetime &quot;created_at&quot;
     t.datetime &quot;updated_at&quot;
+    t.string   &quot;identifier&quot;
+    t.string   &quot;url&quot;
+    t.integer  &quot;stream_id&quot;
+    t.text     &quot;description&quot;
   end
 
 end</diff>
      <filename>db/schema.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,11 @@ ul,li {
 	list-style-type: none;
 }
 
+abbr {
+	text-decoration: none;
+	border-bottom: none;
+}
+
 /* Layout */
 
 .header {
@@ -238,6 +243,7 @@ div.articles a.feedburner {
 
 /* Stream panels */
 
+.trips h3,
 .tagcloud h3,
 .profiles h3 {
 	margin-bottom: 0.8em;
@@ -250,6 +256,7 @@ div.articles a.feedburner {
 	padding: 1em;
 }
 
+.trips,
 .profiles {
 	float: left;
 	width: 300px;
@@ -257,7 +264,23 @@ div.articles a.feedburner {
 }
 
 .profiles li {
-  margin-bottom: 1em;	
+  margin-bottom: 0.8em;	
+}
+
+.trips li {
+	margin-bottom: 0.6em;
+}
+
+.trips li abbr.travel_ends_at,
+.trips li .summary,
+.trips li .description {
+	visibility: hidden;
+	display: none;
+}
+
+.trips li abbr.travel_starts_at {
+	display: block;
+	font-size: 12px;
 }
 
 .profiles .more {</diff>
      <filename>public/stylesheets/application.css</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cef70bc2b4edfa6caa21414b726afe6ef62eda88</id>
    </parent>
  </parents>
  <author>
    <name>Dominiek ter Heide</name>
    <email>info@dominiek.com</email>
  </author>
  <url>http://github.com/dominiek/kakuteru/commit/7aab3e679e9f346192b41e83240a792857bedb36</url>
  <id>7aab3e679e9f346192b41e83240a792857bedb36</id>
  <committed-date>2008-10-12T21:36:59-07:00</committed-date>
  <authored-date>2008-10-12T21:36:59-07:00</authored-date>
  <message>Dopplr.com support for Kakuteru, also exposing all of that with hCalendar microformat</message>
  <tree>abde53c46736ff15bdf683b0c3568e7cc2abafdb</tree>
  <committer>
    <name>Dominiek ter Heide</name>
    <email>info@dominiek.com</email>
  </committer>
</commit>
