Opened 15 years ago
Last modified 11 years ago
#59 closed defect (FIXED)
User feeds
| Reported by: | Christopher Allan Webber | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | programming | Keywords: | |
| Cc: | Parent Tickets: |
Description
We should make an atom feed so you can subscribe to users' posts.
We already have werkzeug as a dependency and it looks like that includes an atom feed generator:
http://flask.pocoo.org/snippets/10/
Whomever works on this should:
- add the feed
- link to the feed on the user profile
- add appropriate metadata to the page so the browser indicates there's an available atom feed
Change History (5)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
So yup, looking good, and those other things you mentioned can come later when our infrastructure better reflects them. :)
Overall this looks really good, and I'm glad to see you're identifying clearly the right pieces of a lot of infrastructure (like url_for_self and adding mediagoblin_head block to root.html which we needed). There are a few things though.
Be sure you're conforming to PEP-8. Particularly, see "Whitespace in Expressions and Statements" and make sure you're applying that in the atom_feed method. http://www.python.org/dev/peps/pep-0008/
The routing copies the 'mediagoblin.user_pages.user_home' identifier but you should really make a new one, probably 'mediagoblin.user_pages.atom_feed'
Use that with request.urlgen to generate the route in user.html that points to the atom feed
ATOM_DEFAULT_NR_OF_UPDATED_ITEMS looks like a global variable, so put it outside of the function definition (right before function is fine)
Looks like there's some inconsistent spacing here (2 spaces instead of 4)
for entry in cursor: feed.add(entry.get('title'), entry.get('description'), content_type='html', author=request.matchdict['user'], updated=entry.get('created'), url= entry.url_for_self(request.urlgen) )We don't have any official styling information about it yet but I prefer {{ foo }} over {{foo}} where possible in templates.
Your work is appreciated! Take care of that and I'll merge!
comment:3 by , 15 years ago
[https://gitorious.org/hunabku/mediagoblin/hunabkus-mediagoblin/commits/feature_atomfeed](https://gitorious.org/hunabku/mediagoblin/hunabkus-mediagoblin/commits/feature_atomfeed)
reviewed version
mentioned points above should be fixed now

[https://gitorious.org/hunabku/mediagoblin/hunabkus-mediagoblin/commits/atomfeed](https://gitorious.org/hunabku/mediagoblin/hunabkus-mediagoblin/commits/atomfeed)
added atom feed under /u/username/atom, browser reference and link on userpage
its currently tracking every uploaded image, this probably need a change later to only include group uploads, so that my 100 vacation pictures are not shown individually and maybe add comments and updates of image description later