def METHOD_NAME(self, text):
    """Add links to the text and collect tags for the post."""
    def _username(m):
        self.add_tag(m.group(1))
        return '`%s <https://twitter.com/%s>`_' % (m.group(0), m.group(1))
    text = twitter_username.sub(_username, text)
    def _hashtag(m):
        self.add_tag(m.group(1))
        return '`%s <https://twitter.com/hashtag/%s>`_' % (m.group(0), m.group(1))
    return twitter_hashtag.sub(_hashtag, text)