- @entries=DiaryEntry.find(:all, :order => 'created_at DESC', :limit=>20)
-
- rss = OSM::GeoRSS.new('OpenStreetMap diary entries', 'Recent diary entries from users of OpenStreetMap', 'http://www.openstreetmap.org/diary')
-
- @entries.each do |entry|
- # add geodata here
- latitude = nil
- longitude = nil
- rss.add(latitude, longitude, entry.title, url_for({:controller => 'user', :action => 'diary', :id => entry.id, :display_name => entry.user.display_name}), entry.body, entry.created_at)
+ if params[:display_name]
+ user = User.find_by_display_name(params[:display_name])
+ @entries = DiaryEntry.find(:all, :conditions => ['user_id = ?', user.id], :order => 'created_at DESC', :limit => 20)
+ @title = "OpenStreetMap diary entries for #{user.display_name}"
+ @description = "Recent OpenStreetmap diary entries from #{user.display_name}"
+ @link = "http://www.openstreetmap.org/user/#{user.display_name}/diary"
+ else
+ @entries = DiaryEntry.find(:all, :order => 'created_at DESC', :limit => 20)
+ @title = "OpenStreetMap diary entries"
+ @description = "Recent diary entries from users of OpenStreetMap"
+ @link = "http://www.openstreetmap.org/diary"