作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要使用 Jquery 显示来自 Twitter 的新推文。
最佳答案
jquery.tweet.js是一个很好用的插件。
启动和运行非常简单,只需下载相关文件并将以下内容添加到您的 html 中(当然,最好将 js 放在外部文件中!)
<script type='text/javascript'> $(document).ready(function(){ $(".tweet").tweet({ username: "seaofclouds", join_text: "auto", avatar_size: 32, count: 3, auto_join_text_default: "we said,", auto_join_text_ed: "we", auto_join_text_ing: "we were", auto_join_text_reply: "we replied to", auto_join_text_url: "we were checking out", loading_text: "loading tweets..." }); });</script><div class="tweet"></div>
它带有一些预定义的样式,但很容易添加您自己的样式。
html 输出是一个无序列表,偶数项和奇数项具有不同的类,例如:
<ul class="tweet_list"> <li class="tweet_first tweet_odd"> <span class="tweet_text">[Tweet text]</span> <span class="tweet_time">about 21 hours ago</span> </li> <li class="tweet_even"> <span class="tweet_text">[Tweet text]</span> <span class="tweet_time">about 22 hours ago</span> </li></ul>
关于jquery - 如何使用 Jquery 获取推文?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3863252/
我想开发一个 Skype 机器人,它将用户名作为输入,并根据用户输入以相反的字符大小写表示hello username。简而言之,如果用户输入他的名字 james,我的机器人会回复他为 Hello J
我是一名优秀的程序员,十分优秀!