Twitter’s Search Widget Showing Too Many Tweets

So this is a quick post from an issue that has frustrated me. I am using and re-styling Twitter’s search widget on a client’s site. When I create it on Twitter’s widget builder, it looks great. When I paste it on the site, it’s not limiting the tweets to 5, it defaults back to 30 or some large number I don’t want.

It’s effectively missing a very simple, but critical JSON property in the root level object, named rpp (results per page, perhaps?).

Example:

<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
  version: 2,
  type: 'search',
  search: 'rainbow',
  interval: 6000,
  rpp: 5,
  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,
    hashtags: true,
    timestamp: true,
    avatars: true,
    toptweets: true,
    behavior: 'default'
  }
}).render().start();
</script>

That’s it. Just add that rpp property and set it to the number you want to limit by and boom!

6 Comments

  1. ideric says…

    Ran into the same problem – thank you!

  2. Detty says…

    Perfect, thanks.

  3. Bas says…

    Thanks, thanks, thanks. Such a frustrating problem and nowhere a solution to be found! Well, here, after googling and swearing for hours…

  4. Els says…

    Thank you! 🙂

  5. Mark says…

    Thank you so much for providing this information. Searched and searched Twitter help to no avail. Binged for hours and found your page and problem solved after much swearing too (much like Bas above).

  6. Mark says…

    BTW, anyone know why the link to the widget builder (not the search widget) takes you to Twitter’s logo and branding rules page? Seems the search widget is the only one that is currently supported by Twitter.

RSS feed for comments on this post. TrackBack URL

Leave a Comment

May 31, 2011

Filed in Development

There are 6 comments »


« Back to the Blog