I’m trying to post using a URL (i.e. abc.com) that redirects to the final destination url (i.e. cnn.com). The issue that I’m seeing is that the twitter card is not showing up (the twitter post becomes just a text with the URL but with no image).
I tried validating the URL using the card validator and it says it’s not whitelisted. In the case that abc.com doesn’t have any images to be scraped, but only the one on cnn.com needs to be scraped, does abc.com still need to be whitelisted?
The white listing message is misleading - check the troubleshooting post Not Whitelisted, unable to render, or no image: READ THIS FIRST
Thanks. Do you know if the twitter card walks through all the redirections to the last url? Right now the abc.com is returning 302. That shouldn’t be a problem for twitter card to keep redirecting until it goes to 200 right?
You should see message about the redirection in the validator if that is working. As mentioned in the post we would need a URL to be shared to verify.
sample url - https://dlt.vitrue.com/dynamic_links/86851?cid=1&t=https%3A%2F%2Fhbr.org%2F2017%2F01%2Fexecutives-and-salespeople-are-misaligned-and-the-effects-are-costly&abc=d&x=y&pn=postname&id=6809459&cpid=223
When fetched using curl that page returns an HTML page with status 200. The page contains JavaScript that apparently does the redirect. There are no cards tags. The cards crawler cannot execute JavaScript so this will not work.
When I run curl -v https://dlt.vitrue.com/dynamic_links/86851?cid=1&t=https%3A%2F%2Fhbr.org%2F2017%2F01%2Fexecutives-and-salespeople-are-misaligned-and-the-effects-are-costly&abc=d&x=y&pn=postname&id=6809459&cpid=2231,
< HTTP/1.1 302 Found
it returns 302. And if you access this page directly on the browser, it takes you to hbr.org. So in the end it’s redirecting to https://hbr.org/2017/01/executives-and-salespeople-are-misaligned-and-the-effects-are-costly.
So the reason why it’s not able to create the twitter card is because the twitterbot will not follow the redirection if it’s in the javascript? (found this post - Javascript redirection will not work for the Twitterbot?)
Can you check this one? It should redirect it to www.cnn.com without using javascript.
curl -v https://dlt.srm-integration.pp1.oraclecloud.com/dynamic_links/138?t=http%3A%2F%2Fwww.cnn.com
GET /dynamic_links/138?t=http%3A%2F%2Fwww.cnn.com HTTP/1.1 Host: dlt.srm-integration.pp1.oraclecloud.com User-Agent: curl/7.48.0 Accept: /
< HTTP/1.1 301 Moved Permanently < Server: nginx < Date: Wed, 08 Feb 2017 22:52:47 GMT < Content-Type: text/html;charset=utf-8 < Content-Length: 0 < Connection: close < Location: http://www.cnn.com < X-XSS-Protection: 1; mode=block < X-Content-Type-Options: nosniff < X-Frame-Options: SAMEORIGIN < Set-Cookie: BIGipServer~Public~shop.srm-integration_pp1_oraclecloud_com_80=rd2o00000000000000000000ffff0a566e96o80; path=/ <
that one seems work.
Is there any workaround that we can make the cards crawler execute? Since we have to use javascript to tracking some data.
I ran curl with the Twitterbot user-agent and I see something different. Either way, yes, Twitterbot cannot run JavaScript.
You will have to have a static HTML shim with card tags if you want to achieve this.
Do you have some examples, how can I do using card tags?
The cards documentation describes the format of meta tags required.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.