2015-10-05 86 views
5

所以我正在测试Twitter和Facebook共享功能。本地主机上的Twitter卡验证器

我目前正在测试Twitter的分享按钮,我在meta标记中添加了标签,经过几个小时的搜索后,我发现对于我能够嵌入推文(在我的推文中嵌入Twitter图片,我的网站)我需要推特卡。

我的元代码:

<meta name="twitter:card" content="summary_large_image"> 
    <meta name="twitter:site" content="http://MY_IP_ADDRESS:3000/"> 
    <meta name="twitter:creator" content="@random"> 
    <meta name="twitter:title" content="Parade of Fans for Houston’s Funeral"> 
    <meta name="twitter:description" content="NEWARK - The guest list and parade of limousines with celebrities emerging from them seemed more suited to a red carpet event in Hollywood or New York than than a gritty stretch of Sussex Avenue near the former site of the James M. Baxter Terrace public housing project here."> 
    <meta name="twitter:image" content="http://cdn0.lostateminor.com/wp-content/uploads/2015/10/Amazing-long-exposure-photos-make-light-look-like-cobwebs-on-trees2-650x434.jpg"> 

然后分享按钮,看起来像:

<img src="http://cdn0.lostateminor.com/wp-content/uploads/2015/10/Amazing-long-exposure-photos-make-light-look-like-cobwebs-on-trees2-650x434.jpg"> 
    <a href="https://twitter.com/intent/tweet?button_hashtag=test" data-url="http://localhost.share.com/" target="_blank">Tweet #test</a> 
    </img> 

当我鸣叫哈希标签,它不接我的图像向上或鸣叫它。所以我一直在试图运行我的网站(我在我的本地主机上测试了它的推特卡验证器)https://cards-dev.twitter.com/validator

我收到此错误信息:error message

任何想法我做了什么错?或者为什么我无法使用我的IP地址,因此我可以测试Twitter卡?

谢谢!

+0

请正确标记!这与'facebook'没什么关系,并且'twitter-boostrap'完全没有。 (标签已移除。) – CBroe

回答

5

我想我会离开这里,因为任何人都会绊倒在这里。自从我问这个问题很久以前,我实际上并没有记住工作,但我认为最简单的解决方案就是使用ngork。

https://ngrok.com/

下载ngrok。运行服务器在本地,然后指向ngrok到本地服务器上运行的端口,它会吐出一些东西线沿线的...

Session Status    online                             
Version      2.1.18                             
Region      United States (us)                          
Web Interface     http://127.0.0.1:4040                          
Forwarding     http://65hkdy7ed.ngrok.io -> localhost:3000                    
Forwarding     https://65hkdy7ed.ngrok.io -> localhost:3000 

有你有自己的网址使用:)

相关问题