4 min read

Twitter in MediaWiki

Twitter (http://www.twitter.com) is a micro-blogging service that allows users to convey the world (or at least the small portion of it on Twitter) what they are doing, in messages of 140 characters or less.

Integrating Twitter and YouTube with MediaWiki

It is possible to embed these messages in external websites, which is what we will be doing for JazzMeet. We can use the updates to inform our wiki’s visitors of the latest JazzMeet being held across the world, and they can send a response to the JazzMeet Twitter account.

Shorter Links

Because Twitter only allows posts of up to 140 characters, many Twitter usersmake use of URL-shortening services such as Tiny URL (http://tinyurl.com), and notlong (http://notlong.com) to turn long web addresses into short, more manageable URLs. Tiny URL assigns a random URL such as http://tinyurl.com/3ut9p4, while notlong allows you to pick a free sub-domain to redirect to your chosen address, such as http://asgkasdgadg.notlong.com.

Twitter automatically shortens web addresses in your posts.

Creating a Twitter Account

Creating a Twitter account is quite easy. Just fill in the username, password, and email address fields, and submit the registration form, once you have read and accepted the terms and conditions. If your chosen username is free, your account is created instantly.

Integrating Twitter and YouTube with MediaWiki

Once your account has been created, you can change the settings such as your display name and your profile’s background image, to help blur the distinction between your website and your Twitter profile. Colors can be specified as “hex” values under the Design tab of your Twitter account’s settings section. The following color codes change the link colors to our JazzMeet’s palette of browns and reds:

Integrating Twitter and YouTube with MediaWiki

As you can see in the screenshot, JazzMeet’s Twitter profile now looks a little more like the JazzMeet wiki. By doing this, the visitors catching up with JazzMeet’s events on Twitter will not be confused by a sudden change in color scheme:

Integrating Twitter and YouTube with MediaWiki

 

Embedding Twitter Feeds in MediaWiki

Twitter provides a few ways to embed your latest posts in to your own website(s); simply log in and go to http://www.twitter.com/badges.

  • Flash: With this option you can show just your posts, or your posts and your friends’ most recent posts on Twitter.
  • HTML and JavaScript: You can configure the code to show between 1 and 20 of your most recent Twitter posts.

As JazzMeet isn’t really the sort of wiki the visitors would expect to find on Flash, we will be using the HTML and JavaScript version. You are provided with the necessary code to embed in your website or wiki. We will add it to the JazzMeet skin template, as we want it to be displayed on every page of our wiki, just beneath our sponsor links. Refer to the following code:









The JavaScript given at the bottom of the code can be moved just above the


Subscribe to the weekly Packt Hub newsletter. We'll send you the results of our AI Now Survey, featuring data and insights from across the tech landscape.

* indicates required

LEAVE A REPLY

Please enter your comment!
Please enter your name here