Just what you need to output a Twitter feed for a chosen account.

Current version: 1.0 Stable

Demonstration

  • Default
    Show usage
    $('#feed').miniFeed({
      username: 'mattaussaguel'
    });
  • Template support

    Matthieu Aussaguel @mattaussaguel

    Show usage
    $('#feed-example-2').miniFeed({
      template: '{time}{tweet}'
    });
    
  • Custom events and animations
    Show usage
    $('#link').click(function(e) {
      e.preventDefault();
      var link = $(this);
      $('#feed').miniFeed({
        username: 'coffeescript',
        'onLoad': function(feed) {
          link.text('Loading...')
         },
        'onLoaded': function(feed) {
          link.hide();
          feed.slideDown('slow');
         }
      });  
    });

Basic Usage

Basic HTML

<div id="feed"></div>

Basic Initialization

$(function() {
  $('#feed').miniFeed({
    username: 'mattaussaguel'  
  });
});

Options

  • username (string)
    Twitter account username.
    Default value is 'mattaussaguel' Show example
    $('#feed').miniFeed({
      username: 'your_username'
    });
  • limit (insteger)
    Number of tweets to be displayed.
    Default value is 6 Show example
    $('#feed').miniFeed({
      limit: 10
    });
  • template (string)
    Tweet template format.
    Default value is '{avatar}{tweet}{time}' Show example
    $('#feed').miniFeed({
      template: '{time}{avatar}'
    });
  • introText (string)
    Text to prepend to every tweet.
    Default value is null Show example
    $('#feed').miniFeed({
      introText: 'New tweet'
    });
  • outroText (string)
    Text to append to every tweet.
    Default value is null Show example
    $('#feed').miniFeed({
      outroText: 'by someone'
    });
  • listClass (string)
    CSS class name added to the list generated.
    Default value is 'tweet-list' Show example
    $('#feed').miniFeed({
      listClass: 'tweet'
    });
  • firstClass (string)
    CSS class name added to the first tweet element.
    Default value is 'first' Show example
    $('#feed').miniFeed({
      firstClass: 'first-tweet'
    });
  • lastClass (string)
    CSS class name added to the last tweet element.
    Default value is 'last' Show example
    $('#feed').miniFeed({
      lastClass: 'last-tweet'
    });
  • avatarSize (string)
    Avatar size in pixels.
    Default value is '48' Show example
    $('#feed').miniFeed({
      avatarSize: '36'
    });
  • avatarClass (string)
    Avatar CSS class name.
    Default value is 'tweet-avatar' Show example
    $('#feed').miniFeed({
      avatarClass: 'avatar'
    });
  • tweetClass (string)
    CSS class name added the generated text wrapper.
    Default value is 'tweet-text' Show example
    $('#feed').miniFeed({
      tweetClass: 'tweet'
    });
  • hideRetweets (boolean)
    Hide retweets.
    Default value is false Show example
    $('#feed').miniFeed({
      hideRetweets: true
    });
  • hideReplies (boolean)
    Hide tweet replies.
    Default value is false Show example
    $('#feed').miniFeed({
      hideReplies: true
    });
  • timeFormat (string)
    Time format. Possible values: 'normal' or 'elapsed'.
    Default value is 'relative' Show example
    $('#feed').miniFeed({
      timeFormat: 'normal'
    });
  • timeClass (string)
    CSS class added to the time wrapper element.
    Default value is 'tweet-time' Show example
    $('#feed').miniFeed({
      timeClass: 'time'
    });
  • onLoad (function)
    Called when the tweets are loading.
    Default value is empty Show example
    $('#feed').miniFeed({
      onLoad: function() {
        // Do what you want
      }
    });
  • onLoaded (function)
    Called when the feed is fully loaded.
    Default value is empty Show example
    $('#feed').miniFeed({
      onLoaded: function(feed) {
        // Do what you want
      }
    });

Connect

About

Matthieu Aussaguel

Avatar

I am a Web Developer currently working at Envato as part of the Marketplace dev team in Melbourne, Australia. I focus mostly on Ruby/Rails technologies but I also enjoy coding in CoffeeScript in my spare time. Head over to my personal website and my Github page for more info about me.