Changeset 635 for confluence
- Timestamp:
- 08/07/09 12:14:31 (12 months ago)
- Files:
-
- 1 modified
-
confluence/feedfilters/twitterfilter.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
confluence/feedfilters/twitterfilter.py
r587 r635 19 19 linkurls = re.compile(r"(https?://[^ ]*)") 20 20 linknames = re.compile(r"@([a-zA-Z0-9_]+)") 21 hashtags = re.compile(r" #([a-zA-Z0-9_]+)")21 hashtags = re.compile(r"(^| )#([a-zA-Z0-9_]+)") 22 22 statusidpattern = re.compile(r"http://twitter.com/.*/statuses/([0-9]*)") 23 23 … … 43 43 text = linkurls.sub(r"<a href='\1'>\1</a>", text) 44 44 text = linknames.sub(r"<a href='http://twitter.com/\1'>@\1</a>", text) 45 text = hashtags.sub(r" <a href='http://search.twitter.com/search?q=%23\1'>#\1</a>", text)45 text = hashtags.sub(r"\1<a href='http://search.twitter.com/search?q=%23\1'>#\2</a>", text) 46 46 text += " <a href='http://twitter.com/home?status=@%s%%20&in_reply_to_status_id=%s&in_reply_to=%s'>Reply</a>" % (username, statusid, username) 47 47 description.data = text
