Invalid URL entity indices in REST API?


#1

Hi,

I noticed a strange URL entity on a particular (re-)tweet (id 419178371399307264) while testing out the REST API.

The text of the tweet:

"text": "RT @mikeketelaars: Here's a website search tool to look into. Tried the demo - works and looks great. @AddSearch So simple... http://t.co/Q\u2026"

The URL entities:

"urls": [
        {
            "expanded_url": "http://techcrunch.com/2014/01/03/addsearch/",
            "indices": [139, 140],
            "display_url": "techcrunch.com/2014/01/03/add\u2026",
            "url": "http://t.co/QOZjDjQJgj"
        }
    ]

As far as I understand, the ‘url’ field should match the corresponding url in the text field, and the indices field should give indices for the beginning and the end of the same url in the raw text.

The values in retweeted_status seem correct:

Text:

"text": "Here's a website search tool to look into. Tried the demo - works and looks great. @AddSearch So simple... http://t.co/QOZjDjQJgj"

URL entities:

"urls": [
            {
                "expanded_url": "http://techcrunch.com/2014/01/03/addsearch/",
                "indices": [107, 129],
                "display_url": "techcrunch.com/2014/01/03/add\u2026",
                "url": "http://t.co/QOZjDjQJgj"
            }
        ]

The post “Changes to Tweet Entities for Retweets” at https://dev.twitter.com/discussions/22510 mentions entities fully truncated from the retweeted text having indices [139, 40], but I think that should not apply here as the URL is still partly visible? Have I misunderstood something, or are the URL entities invalid?

Thanks,
Janne