Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/faisalman/jquery-livetweet

A jQuery plugin to fetch tweets from Twitter
https://github.com/faisalman/jquery-livetweet

Last synced: about 1 month ago
JSON representation

A jQuery plugin to fetch tweets from Twitter

Awesome Lists containing this project

README

        

h1. jQuery LiveTweet documentation

h2. What it does

jQuery LiveTweet is a jquery plugin that fetches your tweets from Twitter.

h2. How to use it


$(document).ready(function() {
$('#your_element').livetweet({
'username' : 'twitter_user'
});
});


h2. Options

* *username*: Your twitter username. Defaults to @jeresig@ (jQuery's creator).
* *limit*: Number of tweets returned. Defaults to @5@.
* *timeout*: Request timeout. Defaults to @2000@ (2 seconds).
* *html_before*: HTML to be rendered before tweets' loop. Defaults to @

    @.
    * *html_after*: HTML to be rendered after tweets' loop. Defaults to @
@.
* *html_tweets*: HTML pattern for tweets. Defaults to @
  • {text}
    {date}
  • @.
    * *use_relative_dates*: Boolean. Uses relative dates such as @2 minutes ago@. Defaults to @true@.
    * *format_date*: Date formatting function. Use it if you set relative dates to false. Defaults to a date like @Wednesday 12 March 2011@.
    * *loading_text*: Text displayed on loading. Defaults to @loading...@.
    * *error_text*: Text displayed on errors. Defaults to @an error has occurred!@.

    h2. Example



    $("#your_element").livetweet({
    'username' : 'sergio_martino',
    'html_before' : 'These are my tweets:
    ',
    'html_tweets' : '{date} | {text}
    ',
    'html_after' : '
    Hello!',
    'loading_text' : 'ehi wait! I\'m loading...',
    });

    h2. Example with custom date



    $("#your_element").livetweet({
    'username' : 'sergio_martino',
    'html_before' : 'These are my tweets:
    ',
    'html_tweets' : '{date} | {text}
    ',
    'html_after' : '
    Hello!',
    'use_relative_dates' : false,
    'format_date' : function(js_date_object) {
    return my_date.getDay()+'/'+my_date.getMonth()+'/'+my_date.getFullYear();
    },
    'loading_text' : 'ehi wait! I\'m loading...',
    'error_text' : 'oooops...'
    });