aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodney Ewing <ewing.rj@gmail.com>2013-07-11 09:37:38 -0700
committerRodney Ewing <ewing.rj@gmail.com>2013-07-11 14:35:44 -0700
commita4dcb1f46a89f33d4946219b02bce6325fb68e50 (patch)
tree7012706bf901940dd158a24cdcc3a4cf0f37eafa
parent44082b12d8a418bacd1ca5b19f7ce2595e07c1ee (diff)
downloadmediagoblin-a4dcb1f46a89f33d4946219b02bce6325fb68e50.tar.lz
mediagoblin-a4dcb1f46a89f33d4946219b02bce6325fb68e50.tar.xz
mediagoblin-a4dcb1f46a89f33d4946219b02bce6325fb68e50.zip
Patch submitted by mrb.
Fix to link to the pubsub hub for atom_feed 'by tag'. Added 'rel': 'alternate' and 'type': 'text/html' to 'atomlinks'
-rw-r--r--mediagoblin/listings/views.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/mediagoblin/listings/views.py b/mediagoblin/listings/views.py
index 35af7148..07dbb3d5 100644
--- a/mediagoblin/listings/views.py
+++ b/mediagoblin/listings/views.py
@@ -14,6 +14,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from mediagoblin import mg_globals
from mediagoblin.db.models import MediaEntry
from mediagoblin.db.util import media_entries_for_tag_slug
from mediagoblin.tools.pagination import Pagination
@@ -80,6 +81,17 @@ def atom_feed(request):
link = request.urlgen('index', qualified=True)
feed_title += "for all recent items"
+ atomlinks = [
+ {'href': link,
+ 'rel': 'alternate',
+ 'type': 'text/html'}]
+
+ if mg_globals.app_config["push_urls"]:
+ for push_url in mg_globals.app_config["push_urls"]:
+ atomlinks.append({
+ 'rel': 'hub',
+ 'href': push_url})
+
cursor = cursor.order_by(MediaEntry.created.desc())
cursor = cursor.limit(ATOM_DEFAULT_NR_OF_UPDATED_ITEMS)
@@ -87,9 +99,8 @@ def atom_feed(request):
feed_title,
feed_url=request.url,
id=link,
- links=[{'href': link,
- 'rel': 'alternate',
- 'type': 'text/html'}])
+ links=atomlinks)
+
for entry in cursor:
feed.add(entry.get('title'),
entry.description_html,