Javascript Widget
Publitweet offers a smarter way to publish your tweets on a website than using the regular Twitter Widgets.
With the Publitweet widget, your visitors can share tweets they see, preview links without leaving your website and enjoy the automatic translation of all the twitter jargon in plain English.
For you, Publitweet will help you engage more with your audience, offer them curated realtime content and last but not least monitor usage right from your Google Analytics.
Once your Twitter feed is activated you can use the following code:
<script src="http://beta.publitweet.com/widgets/javascript.js"></script>
<script>
new Publitweet({
feed : 'nytimes/staff',
filters : {'keywords':'','blacklist':''},
title : 'Liste @nytimes/staff',
description : 'Latest tweets',
headerBackground : '#E7EFF8',
borderColor : '#323232',
width : 500,
height : 600
}).show();
</script>
Options
feed
|
the twitter feed to display (could be a single user 'nytimes' or a twitter list 'nytimes/staff')
|
filters
|
you can filter the tweets that will be displayed in the widget by specifying keywords and blacklisted words.
E.g. {'keywords':'iphone or ipad','blacklist':'microsoft'} => only tweets containing iPhone or iPad (case insensitive) and which do not contain the word Microsoft will be displayed
|
title
|
title of the widget (optional)
|
description
|
description of the widget (optional)
|
headerBackground
|
Color in HTML of the background of the header and footer of the widget
|
borderColor
|
Color in HTML of the borders of the widget (including tweets separator and tabs if displayed)
|
width
|
Width in pixels of the widget (can be 100% to match the widget container's size)
|
height
|
Height in pixels of the widget (can be 'auto' to automatically adjust height based on the tweets displayed, useful if you don't want to have a vertical scrollbar)
|
limit |
Integer between 1 and 200: number of tweets to display in the widget |
language |
default: 'en', could be 'fr' to have the widget in French |
tabs |
default: false, if true clicks on avatar and people's name will open the person's latest tweets in a tab within the widget. It is recommended to use this only if the widget fills the entire page (at least 450 pixels wide) |
profilePage |
You can specify a different URL to open when a user clicks on someone's avatar or name. By default it will open that person's profile on Twitter.com (default value: 'http://twitter.com/' - $screen_name is automatically appended). This only works if the tabs argument is set to false. |
morePage |
You may want to have a small version of the widget in your sidebar or on your homepage which displays a very limited number of tweets and offer the possibility to click to see more on another page where the Publitweet widget has more room. To do that just specify the URL of the page. The footer of the widget will show a link "More tweets". |
signature |
default: '/via @publitweet'. The signature is appended to the tweets shared by the users only if the length of the original tweet plus the signature does not exceed 140 characters. |
showUrlDescription |
If the widget is very small, you may want not to display the full description of attached links. To do that, just set the value of showUrlDescription to false. |
Performance
The Publitweet widget was first designed for big publishers having million of page requests. So it is very efficient in terms of load. For example, the javascript code is separated in two parts.
One cached by the browser that never needs to be refreshed and another one containing tweets that is continuously updated. The former is loaded with the page. As it is cached by the client it is not a problem for performance. The latter is loaded on demand when the widget starts loading so it doesn't penalize the loading time of your page. In fact, if the Publitweet widget never appears in the fold (for example if you put the widget at the bottom of your page and the user doesn't scroll the page down), it will never get loaded.
Comments (0)
You don't have permission to comment on this page.