[openstreetmap-website] Note RSS feed contains too much information and too many timestamps (#1044)

Simon Legner notifications at github.com
Thu Aug 27 18:22:52 UTC 2015


Reading a feed of notes (`/api/0.6/notes/feed?bbox=`) on mobile or text-based readers is confusing (screenshot from [Owncloud News](https://github.com/owncloud/news)):

![selection_106](https://cloud.githubusercontent.com/assets/782446/9529087/9ab9a6ba-4cf8-11e5-99f9-5052bafddc0c.png)


This is due to:
* too many relative timestamps being displayed (the note was resolved 3 minutes ago an hour ago) – indicated in red
* since often `<div>` elements are discarded, the most relevant information, i.e., the comment, is hard to spot – indicated in green
* some part of the information is duplicated – indicated in blue
* furthermore, depending on the RSS generation, the full note might display newer comments than the current one

I propose to largely simplify the text content:
* either to only contain the comment (e.g., show c3 for a note with comments c1, c2, c3, c4)
* or contain all note comments up to the current one in reversed order (e.g., show c3, c2, c1 for a note with comments c1, c2, c3, c4)

For the former, the implementation is as short as (plus some additional clean up)
```diff
diff --git a/app/views/notes/feed.rss.builder b/app/views/notes/feed.rss.builder
index e663d94..ef85064 100644
--- a/app/views/notes/feed.rss.builder
+++ b/app/views/notes/feed.rss.builder
@@ -18,9 +18,7 @@ xml.rss("version" => "2.0",
         xml.link url_for(:controller => "browse", :action => "note", :id => comment.note.id, :anchor => "c#{comment.id}", :only_path => false)
         xml.guid url_for(:controller => "browse", :action => "note", :id => comment.note.id, :anchor => "c#{comment.id}", :only_path => false)
 
-        xml.description do
-          xml.cdata! render(:partial => "entry", :object => comment, :formats => [ :html ])
-        end
+        xml.description comment.body
 
         if comment.author
           xml.dc :creator, comment.author.display_name
```

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/1044
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20150827/79075ac4/attachment.html>


More information about the rails-dev mailing list