Twitter Search Widget

一世执手 提交于 2020-01-23 17:19:07

问题


I can only seem to get the twitter search widget to display the most recent three tweets. Can this be extended? How far back in time does the widget retrieve information?


回答1:


It's strange that there are only three tweets showing, because the default is 30 in the widget as I know, except if there are only three tweets related to the search term!

However, you can add whatever optional properties you want to the widget, see all with details here. For going back in time I think since_id and until are going to interest you.

If you want to determine the number of tweets to show, you should use the rpp property, which can have a max value 0f 100, this is an example:

<script charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'search',
  search: 'rainbow',
  interval: 30000,
  rpp: 50,                   // WE ARE HERE IN THE VERY BODY OF THE OBJECT!
  title: 'It\'s a double rainbow',
  subject: 'Across the sky',
  width: 250,
  height: 300,
  theme: {
    shell: {
      background: '#8ec1da',
      color: '#ffffff'
    },
    tweets: {
      background: '#ffffff',
      color: '#444444',
      links: '#1985b5'
    }
  },
  features: {
    scrollbar: false,
    loop: true,
    live: true,
    behavior: 'default'
  }
}).render().start();
</script>

Hope that's useful!



来源:https://stackoverflow.com/questions/8979622/twitter-search-widget

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!