Does track keywords do a search on expanded urls?


#1

Hi,

I would like to track all the tweets that mentions my website (lets say http://google.com). I can specify track keywords as google, com and write some custom code to filter tweets that contains urls or subdomains of this url as suggested in the twitter documentation. But does the api also return the tweets that has http://google.com (or sub domains) posted using url shorteners (which is not t.co)

Thanks,
Aditya


#2

Hi Aditya,

Matching is performed on the contents of the entities.urls array. When shortened URLs are posted as part of the tweet this metadata will only include the t.co shortened url, the display_url (as written in the Tweet body)… and in this case the expanded_url is essentially the same as the display_url. So in this case there would be no matching for terms in the non-shortened URL. (I included a JSON example below)

For what it is worth, Gnip (Twitter’s “enterprise data” provider) Activity Stream format includes a fully expanded URL. For more information, see http://support.gnip.com/enrichments/expanded_urls.html

"entities": {
    "urls": [
      {
        "url": "http:\/\/t.co\/SoaTsqt47v",
        "expanded_url": "http:\/\/goo.gl\/xYe5Qh",
        "display_url": "goo.gl\/xYe5Qh",
        "indices": [
          36,
          58
        ]
      }
    ]
  }

#3

Thanks for the response, Snowman. Gnip’s twitter activity stream might be a better fit for us given we want the filters to work on shortened url’s using third party services.