Skip to content

put twitter on your website with tweet, an unobtrusive javascript plugin for jquery

License

Notifications You must be signed in to change notification settings

DanielKulbe/tweet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tweet!

Put twitter on your website with tweet!, an unobtrusive javascript plugin for jquery.

Demos & examples

See tweet.seaofclouds.com (original version), or the bundled index.html file.

customized

See issue #288 for customizion intention.

Customized at 08/31/2012 by Daniel Kulbe for Drupal module integration called "Tweet!"

Source

Download tarball

Features

  • small size and fast download time
  • will not slow down or pause your page while tweets are loading
  • display up to 100 tweets, as permitted by the twitter search api
  • display tweets from a twitter search, or from your own feed
  • optional verb tense matching, for human readable tweets
  • optionally display your avatar
  • optionally display tweets from multiple accounts!
  • automatic linking of @replies to users’ twitter page
  • automatic linking of URLs
  • automatic linking of #hashtags, to a twitter search of all your tags
  • converts <3 to a css styleable ♥ (we ♥ hearts)
  • customize the style with your own stylesheet or with other jquery plugins
  • customize the layout with a user-defined template function
  • supports RequireJS and other AMD-compatible javascript loaders
    • optionally display format an absolute time

Usage

  1. Get JQuery. In these examples, we use Google's AJAX Libraries API.

  2. include jQuery and jquery.tweet.js files in your template's <head>.

     <script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
     <script language="javascript" src="/tweet/jquery.tweet.js" type="text/javascript"></script>
    
  3. Also in <head>, Initialize tweet! on page load with your Username and other options

     <script type='text/javascript'>
         jQuery(function($){
             $(".tweet").tweet({
                 join_text: "auto",
                 avatar_size: 32,
                 count: 3,
                 loading_text: "loading tweets..."
             });
         });
     </script>
    
  4. In <body>, include a placeholder for your tweets. They'll get loaded in via JSON. How fancy!

     <div class="tweet"></div>
    
  5. Style with our stylesheet in <head>, or modify as you like!

     <link href="jquery.tweet.css" media="all" rel="stylesheet" type="text/css"/>
    

Default variables

  • username: null - [string or array] required unless using the 'query' option; one or more twitter screen names (use 'list' option for multiple names, where possible)
  • relative_time: true - [boolean] wether to show a relative time
  • format_time: "{tweet_mon}/{tweet_day}/{tweet_year} - {tweet_hour}:{tweet_minutes}" - [string] time format when display an absolute time, we use the international time format symbols
  • list: null - [string] optional name of list belonging to username
  • favorites: false - [boolean] display the user's favorites instead of his tweets
  • query: null - [string] optional search query (see also: http://search.twitter.com/operators)
  • avatar_size: null - [integer] height and width of avatar if displayed (48px max)
  • count: 3 - [integer] how many tweets to display?
  • fetch: null - [integer] how many tweets to fetch via the API (set this higher than 'count' if using the 'filter' option)
  • page: 1 - [integer] which page of results to fetch (if count != fetch, you'll get unexpected results)
  • retweets: true - [boolean] whether to fetch (official) retweets (not supported in all display modes)
  • intro_text: null - [string] do you want text BEFORE your your tweets?
  • outro_text: null - [string] do you want text AFTER your tweets?
  • join_text: null - [string] optional text in between date and tweet, try setting to "auto"
  • auto_join_text_default: " I said, " - [string] auto text for non verb: "I said" bullocks
  • auto_join_text_ed: " I " - [string] auto text for past tense: "I" surfed
  • auto_join_text_ing: " I am " - [string] auto tense for present tense: "I was" surfing
  • auto_join_text_reply: " I replied to " - [string] auto tense for replies: "I replied to" @someone "with"
  • auto_join_text_url: " I was looking at " - [string] auto tense for urls: "I was looking at" http:...
  • loading_text: null - [string] optional loading text, displayed while tweets load
  • refresh_interval: null - [integer] optional number of seconds after which to reload tweets
  • twitter_url: "twitter.com" - [string] custom twitter url, if any (apigee, etc.)
  • twitter_api_url: "api.twitter.com" - [string] custom twitter api url, if any (apigee, etc.)
  • twitter_search_url: "search.twitter.com" - [string] custom twitter search url, if any (apigee, etc.)
  • template: "{avatar}{time}{join}{text}" - [string or function] template used to construct each tweet li - see code for available vars
  • filter: function(tweet) {...} - [function] whether or not to include a particular tweet (be sure to also set 'fetch')

Contribute

Bring your code slinging skills to Github and help us develop new features for tweet!

Original Github project page

git clone git://github.com/seaofclouds/tweet.git

Report bugs at http://github.com/seaofclouds/tweet/issues

Licensed under the MIT

License text

About

put twitter on your website with tweet, an unobtrusive javascript plugin for jquery

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.6%
  • Ruby 1.4%