문제

I'm retrieving tweets via the Twitter anywhere API. I would like to treat pure text tweets and tweets that contain a picture differently.
I can do that by filtering for pic.twitter.com urls. Unfortunately the API delivers short urls ala t.co.

Is there a way to resolve these via Javascript (jQuery)?

도움이 되었습니까?

해결책

You won't be able to resolve t.co URLs with AJAX because of Same Origin Policy. Basically, you are only allow to make requests to the server that hosts your page.

However, Twitter has a very rich API and contains very detailed metadata about elements in each tweet. You should read the tweet entities documentation. These fields appear in the JSON documents of the REST API.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top