Twitter官方的Flash代码是不符合XHTML规则的,不但使用了<embed>而且还使用了&作为flashvar传递信息的连接符,所以多导致30多个错误。在网上搜了不少,有Twitter旧的Flash Badge更改的例子,但是没有新的带朋友更新的Badge修改的例子,研究了一番,试了很多遍之后,总算是通过的XHTML的认证。我不是这方面的专家,只能靠一次又一次的尝试来通过这个验证。
使用Twitter官方的badge生成器代码是这样的:
<div style=”width:200px;text-align:center”>
<embed src=”http://static.twitter.com/flash/twitter_timeline_badge.swf” flashvars=”user_id=2*****1&color1=0xCEFFF8&color2=0xAAE1E2&textColor1=0x4A396D&textColor2=0xBA0909&backgroundColor=0xEFE0D5&textSize=11” width=”180″ height=”400″ quality=”high” name=”twitter_timeline_badge” align=”middle” type=”application/x-shockwave-flash” allowScriptAccess=”always” type=”application/x-shockwave-flash” pluginspage=”http://www.adobe.com/go/getflashplayer”></embed><br>
<a style=”font-size: 10px; color: #0xBA0909; text-decoration: none” href=”http://static.twitter.com/icebenny”><img src=”http://static.twitter.com/images/twitter_bubble_logo.gif” border=”0″ /></a></div>
*注user_id为个人的id,中间5位用”*”代替了。其中的宽度和颜色都做了修改。
其 中红色部分是无法通过验证的,最大的问题就是<embed>和flashvars的部分问题最多。<embed>要 用<object>替代,而flashvars的值当中的”&”也是不能用的。<br>和<img>是比较 弱智的问题了,在w3c验证中根据提示改下就可以了,最后得到的代码为:
<div><object type=”application/x-shockwave-flash” data=”http://twitter.com/flash/twitter_timeline_badge.swf” width=”180″ height=”400″ >
<param name=”flashvars” value=”user_id=2*****1&color1=0xCEFFF8&color2=0xAAE1E2&textColor1=0x4A396D&textColor2=0xBA0909&backgroundColor=0xEFE0D5&textSize=11” />
<param name=”movie” value=”http://twitter.com/flash/twitter_timeline_badge.swf” /></object><br />
<center><a style=”font-size: 10px; color: #0xBA0909; text-decoration: none” href=”http://static.twitter.com/icebenny”><img src=”http://static.twitter.com/images/twitter_bubble_logo.gif” border=”0″ alt=”twitter” /></a></center></div>
<div class=”PT”></div>
要注意的是其中的淡紫色的部分和绿色的部分,要根据原始的代码进行调整。而下面的图片因为失去了居中的对应关系,我用了<center>其实也不是好的办法,还望高人指教。
这样修改后就可以通过w3c的验证了。

昨天写道关于不支持Rss输入的网站,可以

很遗憾
1和2介绍的这些方法其实在在线阅读器都可以很方便的解决,所以推荐使用的还是在线阅读器,但是你的网络连接不是实时的,那么还是离线阅读器来得方便。
还不满意?那试试
