Hi,
Recently we have seen issues where the indices in the entities, both for URLs and media, are returned incorrectly when retrieving a Tweet from the API endpoint GET statuses/show/:id
For example:
Incorrect URL entity indices:
Tweet: https://twitter.com/SunRacing/status/1112248159739301888
Tweet id: 1112248159739301888
Tweet text:
💬 "His previous form is good and I’m expecting him to lead them all home from the front..."
🤓 | @Templegate_tips picks out his best bets for Sunday's racing from @Ascot & @DoncasterRaces:
https://t.co/DQjT72EBih
URL entities in the response:
urls: [
{
display: "thesun.co.uk/sport/horserac…"
expanded: "https://www.thesun.co.uk/sport/horseracing/8742612/templegates-racing-tips-ascot-sunday-march-31/"
url: "https://t.co/DQjT72EBih"
indices: [195,218]
}
]
But the indices are incorrect and the url indices seems like it should be starting at 191.
An example of incorrect media entity indices:
Tweet: https://twitter.com/NiamhAlgar/status/1122826695579439107
Tweet id: 1122834570280361984
Tweet text:
RT @NiamhAlgar: Thanks for having us @VirginRadioUK & @achrisevans about #TheVirtues ♥️🎬📻 @StephenGraham73 https://t.co/XrWtyDjoBX
Media entities in the response:
media: [
{
id: 1122826573109919744,
id_str: "1122826573109919744",
media_url_http: "http://pbs.twimg.com/media/D5UU0bqWAAA0LXB.jpg",
media_url_https: "https://pbs.twimg.com/media/D5UU0bqWAAA0LXB.jpg"
type: "photo"
display: "pic.twitter.com/XrWtyDjoBX"
expanded: "https://twitter.com/NiamhAlgar/status/1122826695579439107/photo/1"
url: "https://t.co/XrWtyDjoBX"
indices: [107,130]
},
{
id: 1122826657608425473,
id_str: "1122826573109919744",
media_url_http: "http://pbs.twimg.com/media/D5UU5WcW4AEkYjG.jpg",
media_url_https: "https://pbs.twimg.com/media/D5UU5WcW4AEkYjG.jpg"
type: "photo"
display: "pic.twitter.com/XrWtyDjoBX"
expanded: "https://twitter.com/NiamhAlgar/status/1122826695579439107/photo/1"
url: "https://t.co/XrWtyDjoBX"
indices: [111,134]
},
]
The first media entity (id: 1122826573109919744) has the correct indices but the second should have the same indices as the first as have the same URL. So the second media entity should also have the indices [107,130].
Another example of incorrect media entity indices for videos:
Tweet: https://twitter.com/SunRacing/status/1112421802741911552
Tweet id: 1112421802741911552
Tweet text:
🗣 “The money isn’t important to me — Everyone wants to win the big races.”
🎤 | Great interview from @MCYeeehaaa & @oismurphy as they reflect on Gronkowski’s valiant effort in yesterday’s #DubaiWorldCup:
https://t.co/bIIdAHHrIx
Media entities in the response: 1112421802741911552
media: [
{
id: 1112338006906527745,
id_str: "1112338006906527745",
media_url_http: "http://pbs.twimg.com/media/D2_RyKlVYAAbQh_.jpg",
media_url_https: "https://pbs.twimg.com/media/D2_RyKlVYAAbQh_.jpg"
type: "video"
display: "pic.twitter.com/bIIdAHHrIx"
expanded: "https://twitter.com/AtTheRaces/status/1112338300138737665/video/1"
url: "https://t.co/bIIdAHHrIx"
indices: [209,232]
}
]
The entity indices should be returned as the start and end of the URL but are not correct. It should be starting at 207. The end is also incorrect as the text length is less than 232.
Any help would be greatly appreciated.
Thanks