Allow one to subscribe to planet feeds

This commit is contained in:
Sam Ruby 2006-12-27 15:37:16 -05:00
parent 9d7627781c
commit 6f7eddf0f0
3 changed files with 22 additions and 4 deletions

View File

@ -262,10 +262,12 @@ def reconstitute(feed, entry):
# merge in planet:* from feed (or simply use the feed if no source) # merge in planet:* from feed (or simply use the feed if no source)
src = entry.get('source') src = entry.get('source')
if src: if src:
for name,value in feed.feed.items(): for name,value in feed.feed.items():
if name.startswith('planet_'): src[name]=value if name.startswith('planet_'): src[name]=value
if feed.feed.has_key('id'):
src['planet_id'] = feed.feed.id
else: else:
src = feed.feed src = feed.feed
# source:author # source:author
src_author = src.get('author_detail',{}) src_author = src.get('author_detail',{})

View File

@ -81,7 +81,9 @@ def splice():
if sources: if sources:
ids = sources[0].getElementsByTagName('id') ids = sources[0].getElementsByTagName('id')
if ids and ids[0].childNodes[0].nodeValue not in sub_ids: if ids and ids[0].childNodes[0].nodeValue not in sub_ids:
continue ids = sources[0].getElementsByTagName('planet_id')
if not ids: continue
if ids[0].childNodes[0].nodeValue not in sub_ids: continue
# add entry to feed # add entry to feed
feed.appendChild(entry.documentElement) feed.appendChild(entry.documentElement)

View File

@ -0,0 +1,14 @@
<!--
Description: source id
Expect: source.planet_id == 'http://example.com/'
-->
<feed xmlns="http://www.w3.org/2005/Atom">
<id>http://example.com/</id>
<entry>
<source>
<id>http://example.org/</id>
</source>
</entry>
</feed>