Skip to content

Instantly share code, notes, and snippets.

@mrvdb
Created February 10, 2013 16:37
Show Gist options
  • Save mrvdb/4750145 to your computer and use it in GitHub Desktop.
Save mrvdb/4750145 to your computer and use it in GitHub Desktop.
diff --git a/mediagoblin/listings/views.py b/mediagoblin/listings/views.py
index d37161f..220095c 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
@@ -77,15 +78,25 @@ def tag_atom_feed(request):
"""
ATOM feed id is a tag URI (see http://en.wikipedia.org/wiki/Tag_URI)
"""
+ atomlinks=[{
+ 'href': request.urlgen(
+ 'mediagoblin.listings.tags_listing',
+ qualified=True, tag=tag_slug )
+ }]
+
+ if mg_globals.app_config["push_urls"]:
+ for push_url in mg_globals.app_config["push_urls"]:
+ atomlinks.append({
+ 'rel': 'hub',
+ 'href': push_url})
+
feed = AtomFeed(
"MediaGoblin: Feed for tag '%s'" % tag_slug,
feed_url=request.url,
id='tag:'+request.host+',2011:gallery.tag-%s' % tag_slug,
- links=[{'href': request.urlgen(
- 'mediagoblin.listings.tags_listing',
- qualified=True, tag=tag_slug ),
- 'rel': 'alternate',
- 'type': 'text/html'}])
+ links=atomlinks)
+
+
for entry in cursor:
feed.add(entry.get('title'),
entry.description_html,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment