I've been using TwitterOAuth for some time, so it might be a little outdated but I think that doesn't matter in this case. The problem I have is with images. When you embed an image in Twitter post, as a result I'm getting simple text link to that page on Twitter showing the picture. That link is a part of text message from the feed.
It looks like this:
Twitter message goes here, there some http://link.com. There is https://www.another-link.net/blabla/. Love you all. https://twitter.com/zzz/status/123123132132/photo/1
I'd like to strip those picture-links out of the text feed I'm reading by PHP. It could be as simple as strip links containing "/photo/". However, Twitter wraps all links, including those, in T.CO (link shortening tool). So all the links look like http://t.co/ZZZ0123ZZZ
Twitter message goes here, there some http://t.co/abc. There is http://t.co/def. Love you all. http://t.co/ghi
That prevents me from simple search & replace. I don't know which link is a real link and which is an image-link. I can't strip the last link either because there might not be any image and the last link could be a real link to something I'd like to keep.
Is there any way to strip those image links? Other than actually follow the link with curl or something, so I know where it leads.