Twitter 的 UI Mash-up Service可分为三大块: 1. Web Intents — 一些链接,点了就能产生twitter的内容 2. Button — 你的页面上将看到一些Button 3. Widget — 你的页面上将看到一些widget,点其中的按钮或链接后将弹出新页面 下面逐个介绍一下这三类Service,重点将放在集成方式上(js or iframe, 页面大小等) 1. Web Intents Web Intents就是指向twitter网站一些特定内容的链接 <p><a href="http://twitter.com/intent/tweet?in_reply_to=51113028241989632">Reply</a></p> <p><a href="http://twitter.com/intent/retweet?tweet_id=51113028241989632">Retweet</a></p> <p><a href="http://twitter.com/intent/favorite?tweet_id=51113028241989632">Fav</a></p> 不过,twitter建议以pop-up的方式使用这些链接,并让弹出窗口的大小保持在550 * 420 你可以手动实现这种方式,也可以使用twitter提供的out-of-box支持:引入http://platform.twitter.com/widgets.js <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> <p><a href="http://twitter.com/intent/tweet?in_reply_to=51113028241989632">Reply</a></p> <p><a href="http://twitter.com/intent/retweet?tweet_id=51113028241989632">Retweet</a></p> <p><a href="http://twitter.com/intent/favorite?tweet_id=51113028241989632">Fav</a></p> 那用iframe行不行? <iframe src="http://twitter.com/intent/tweet?in_reply_to=51113028241989632"/> 我试了一下,第一个页面的展现没有问题,但如果在iframe里玩tweet时,很容易出现窗口大小问题和滚动条等问题。所以Twitter并不推荐这种做法:“While you can …
Twitter 的 Mash-up Service的集成方式 Read More »