Ticket #633: bytag_pubsub.diff

File bytag_pubsub.diff, 1.5 KB (added by mrb, 11 years ago)

Patch

  • mediagoblin/listings/views.py

    diff --git a/mediagoblin/listings/views.py b/mediagoblin/listings/views.py
    index d37161f..220095c 100644
    a b  
    1414# You should have received a copy of the GNU Affero General Public License
    1515# along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1616
     17from mediagoblin import mg_globals
    1718from mediagoblin.db.models import MediaEntry
    1819from mediagoblin.db.util import media_entries_for_tag_slug
    1920from mediagoblin.tools.pagination import Pagination
    def tag_atom_feed(request):  
    7778    """
    7879    ATOM feed id is a tag URI (see http://en.wikipedia.org/wiki/Tag_URI)
    7980    """
     81    atomlinks=[{
     82        'href': request.urlgen(
     83            'mediagoblin.listings.tags_listing',
     84            qualified=True, tag=tag_slug )
     85        }]
     86   
     87    if mg_globals.app_config["push_urls"]:
     88        for push_url in mg_globals.app_config["push_urls"]:
     89            atomlinks.append({
     90                'rel': 'hub',
     91                'href': push_url})
     92   
    8093    feed = AtomFeed(
    8194        "MediaGoblin: Feed for tag '%s'" % tag_slug,
    8295        feed_url=request.url,
    8396        id='tag:'+request.host+',2011:gallery.tag-%s' % tag_slug,
    84         links=[{'href': request.urlgen(
    85                  'mediagoblin.listings.tags_listing',
    86                  qualified=True, tag=tag_slug ),
    87             'rel': 'alternate',
    88             'type': 'text/html'}])
     97        links=atomlinks)
     98
     99
    89100    for entry in cursor:
    90101        feed.add(entry.get('title'),
    91102            entry.description_html,