jTweetsAnywhere is a jQuery Twitter Widget that simplifies the integration of Twitter services into your site.
With just a few lines of Javascript you can
$('#twts').jTweetsAnywhere({
username: 'tbillenstein',
count: 5
});
The downloadable zip archive contains the Javascript source file in it's original and a fastloading minified version and a basic CSS file that serves as a sample for tweaking the UI.
<head> sectionYou will need the jQuery library. jQuery Version 1.4.2 (minified) is recommended. You can also hotlink to one of the hosted versions
<head>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="jquery.jtweetsanywhere-1.0.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="jquery.jtweetsanywhere-1.0.1.css" />
</head>
Twitter's @Anywhere features (like Hovercards, Tweet Box, Follow Button, etc.) are optional. If you don't need them, just skip the next paragraphs and continue with the next section. Keep in mind that you can integrate any kind of tweet feed into your site without the need of @Anywhere.
If you want to use Twitter's @Anywhere features,
you must include Twitter's anywhere.js inside your
<head> section. In order to start using @Anywhere, you have to
register
your site (application) and obtain an APIKey (also called Consumer Key) from Twitter. When registering, be sure to select
"Read & Write" for the Default Access type.
<script type="text/javascript" src="http://platform.twitter.com/anywhere.js?id=APIKey&v=1"></script>
Read this note for registration details and how to set up a local web server for testing purposes.
<body>
...
<div id="tweetsFeed">
</div>
...
</body>
$(document).ready(function(){
$('#tweetsFeed').jTweetsAnywhere({
username: 'tbillenstein',
count: 5,
showTweetBox: { label: '<span style="color: #D1C7BA">Spread the word ...</span>' }
});
});
The Demo page shows a lot more samples of what can be done with the widget and how it can be tweaked to display the results you expect.
This section describes all configurable plugin options.
username
tbillenstein
'tbillenstein' or ['twitterapi', 'ChromiumDev']list
null
'ajaxians'searchParams
null
'q=twitter' or ['q=twitter', 'geocode=48.856667,2.350833,30km']count
0
tweetProfileImagePresent
true/false) that specifies whether to display profile images in
tweets. If the param is set to null (the default value), a profile image
is displayed only if the feed represents a user's list or the result of a
Twitter search.
null
showFollowButton
true/false) that specifies whether to display a Twitter "Follow Button".
false
showConnectButton
true/false) that specifies whether to display a Twitter "Connect Button" or an object
literal representing the configuration options for the "Connect Button". The configuration options and their
default values are:
{
size: "medium" // String - The size of the Connect Button.
// Valid values are: small, medium,
// large, xlarge
}
false
showLoginInfo
true/false) that specifies whether to display Login Infos.
false
showTweetBox
true/false) that specifies whether to display a Twitter "Tweet Box" or an object
literal representing the configuration options for the "Tweet Box". The configuration options and their
default values are:
{
counter: true, // Boolean - Display a counter in the Tweet Box
// for counting characters
width: 515, // Number - The width of the Tweet Box in px
height: 65, // Number - The height of the Tweet Box in px
label: "What's happening", // String - The text above the Tweet Box
defaultContent: <none>, // String - Pre-populated text in the Tweet Box.
// Useful for an @mention, a #hashtag,
// a link, etc.
onTweet: <none> // Function - Specify a listener for when a tweet
// is sent from the Tweet Box. The
// listener receives two arguments:
// a plaintext tweet and an HTML tweet
}
false
{ counter: true, width: 380, height: 65 }mainDecorator
defaultMainDecorator
tweetFeedDecorator
defaultTweetFeedDecorator
tweetDecorator
defaultTweetDecorator
tweetProfileImageDecorator
defaultTweetProfileImageDecorator
tweetBodyDecorator
defaultTweetBodyDecorator
tweetTextDecorator
defaultTweetTextDecorator
tweetTimestampDecorator
defaultTweetTimestampDecorator
connectButtonDecorator
defaultConnectButtonDecorator
loginInfoDecorator
defaultLoginInfoDecorator
loginInfoContentDecorator
defaultLoginInfoContentDecorator
followButtonDecorator
defaultFollowButtonDecorator
tweetBoxDecorator
defaultTweetBoxDecorator
linkDecorator
defaultLinkDecorator
usernameDecorator
defaultUsernameDecorator
hashtagDecorator
defaultHashtagDecorator
loadingDecorator
defaultLoadingDecorator
jTweetsAnywhere is licensed under the MIT license.
In case of any question, suggestion or problem you have using jTweetsAnywhere, please don't hesitate to
contact me.
There are several ways to
get in touch.