LanzaroteTweets widget v2

+32000 Lanzarote tweets | May 21, 2012 | 03:48 local time
| Share

Here's a functional demo and instructions of how to use and implement LanzaroteTweets widget v2 on your own website. Simply insert a couple of lines of JavaScript code into your webpages and you're done.

The code is based on the Official Twitter Widget. For which reason you can easily re-use and adopt an existing Twitter widget to work with the LanzaroteTweets widget by simply changing one line of JavaScript code.

This page last updated: 26-Jul-2010

Quick access:

Example

In this example we used the code shown below to produce a 450 pixels wide by 300 pixels high widget containing relevant Lanzarote tweets being displayed every 3000 milliseconds:

The code

In order to achieve this, simply insert the following JavaScript code into your HTML page:

<script src="http://widgets.tlanz.com/en-widget2.js"></script>
<script>
new TWTR.Widget({
	version: 2,
	type: 'search',
	search: 'lanzarote',
	interval: 3000,
	title: '',
	subject: '',
	width: 450,
	height: 300,
	theme: {
		shell: {
			background: '#8ec1da',
			color: '#ffffff'
		},
		tweets: {
			background: '#ffffff',
			color: '#444444',
			links: '#1985b5'
		}
	},
	features: {
		scrollbar: true,
		loop: false,
		live: true,
		hashtags: true,
		timestamp: true,
		avatars: true,
		toptweets: true,
		behavior: 'default'
	}
}).render().start();
</script>

Customization

Feel free to play around with the above code and parameters. You probably want to modify at least the parameters listed in bold. As well as the colors used in the shell and tweets theme.

Special parameters

To hide the widget footer that links to Twitter (seriously, why would anyone want to do that ? well, at least consider mentioning or linking back to Twitter.com somewhere else on the page), add this parameter to the features section:

custom_hide_footer: true

The default behaviour is to always display the widget footer (value defaults to false).

Language

If you prefer another language than the default English, just change the first line:

<script src="http://widgets.tlanz.com/en-widget2.js"></script>

of the above JavaScript, so that for Spanish language it becomes:

<script src="http://widgets.tlanz.com/es-widget2.js"></script>

and for Italian language it becomes:

<script src="http://widgets.tlanz.com/it-widget2.js"></script>

Notice that this language-selection only affects the behaviour of the widget interface and so does not apply to the selection of tweets displayed. This may however be implemented in the future, probably by adding a language parameter to the above JavaScript code.

Changelog

04-Sep-2010
problem: as the size of the database kept growing, it starting to exceed capacity
of server leading to increasingly slower queries and widget response times.
quick fix: moved the database to another server. queries are considerably faster now,
even exceeding previous server when using a small database.
real solution: at least optimize queries/tables to make even better use of indexes.
will however leave this for sometime in the future when the dataset starts outgrowing
the current resources.
26-Jul-2010
added a changelog to keep track of updates and changes.
26-Jul-2010
added a new feature parameter custom_hide_footer that allows to
hide the widget footer that links to Twitter. default value is false.
26-Jul-2010
previously the widget parameters title and caption were
always overwritten with a default text. this functionality has now been
removed and custom titles and captions can be used. if no title or caption
is provided, default texts are used.
25-Jul-2010
public release of new v2 of widget. created this page. added some basic documentation.
18-Jul-2010
implemented new v2 widget on beta test sites.

Further information

Feel free to drop us a line in spanish or english if you have any questions, problems or suggestions: lanzarotify.com.