def METHOD_NAME(site, public_url, line):
    tweet = json.loads(line)
    modified = False
    for url in tweet['entities']['urls']:
        if url['expanded_url'].startswith(public_url):
            path = url['expanded_url'].replace(
                public_url, '').split('?')[0].strip('/')
            ob = None
            if path in ('', '/'):
                try:
                    ob = site[site.default_page]
                except Exception:
                    pass
            else:
                ob = site.restrictedTraverse(path, None)
            if ob is None:
                redirector = getUtility(IRedirectionStorage)
                obj_path = redirector.get(path, default=None)
                if obj_path:
                    ob = site.restrictedTraverse(obj_path, None)
            if ob:
                modified = True
                record_tweet_stats(site, ob, tweet)
    if modified:
        transaction.commit()
        index_in_es()