Changeset 747
- Timestamp:
- 03/24/10 15:51:46 (23 months ago)
- Files:
-
- 1 modified
-
confluence/feedfilters/twitterfilter.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
confluence/feedfilters/twitterfilter.py
r635 r747 22 22 statusidpattern = re.compile(r"http://twitter.com/.*/statuses/([0-9]*)") 23 23 24 def url_replace(mobj): 25 url = mobj.group(1).replace("@", "%40") 26 return r"<a href='%s'>%s</a>" % (url, url) 27 24 28 xml = xml.dom.minidom.parseString(sys.stdin.read()) 25 29 … … 41 45 statusid = statusidpattern.match(guid.data).group(1) 42 46 43 text = linkurls.sub( r"<a href='\1'>\1</a>", text)47 text = linkurls.sub(url_replace, text) 44 48 text = linknames.sub(r"<a href='http://twitter.com/\1'>@\1</a>", text) 45 49 text = hashtags.sub(r"\1<a href='http://search.twitter.com/search?q=%23\1'>#\2</a>", text)
