Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Javascript library for converting #hash_tags, @user_mentions, and URLs to links.

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.rdoc

linkify_tweet

Adds links to the result returned by the Twitter statuses/user_timeline API call. The include_entities parameter must be set to 1.

Usage

Download linkify_tweet.js and include it. Then call the linkify_tweet function on a tweet returned by statuses/user_timeline.

Example using jQuery

HTML:

<div class="twitter-bubble" data-twitter-user="legalnomads"></div>

jQuery:

$(".twitter-bubble").each(function() {
  var thisBubble = $(this);
  $.getJSON("http://api.twitter.com/1/statuses/user_timeline.json?callback=?", {
    count: 1,
    include_entities: 1,
    screen_name: thisBubble.data("twitter-user")
  }, function(data) {
    thisBubble.html(linkifyTweet(data[0]));
  });
});

Compiling coffeescripts

The easiest way is to use Guard. Make sure you have Ruby and Bundler installed, then install the dependencies by running

bundle install

Start guard in this folder by running

guard

Guard will then automatically recompile coffeescripts as they change.

Contributing

The best way to contribute is to submit a spec.

License

linkify_tweet is released under the MIT license.

Something went wrong with that request. Please try again.