Locally Hosted Twitter Search Widget
Twitter Search Widget
Twitter List Widget
Why a standalone Twitter widget?
Many versions of the Twitter Search Widget have been customised for CMSs such as Wordpress. Following some simple instructions, these are quite easy to install. For non CMS websites, there are a number of bespoke Twitter search clients available, many of which offer powerful options.
Locally hosting the standard Twitter Search Widget has the advantage of simplicity. There is the attraction that as the Twitter Widget is purely JavaScript, it can be also be inserted into static HTML pages. Two examples of the Twitter Widget are demonstrated, a search widget and a list widget.
Instructions for use
- Download and unzip the twitter_search_widget.zip file to a local disc. The twitter_search_widget.zip file is a replica of this example and can run from the local disc or a USB stick.
- Copy the directories 'css', 'images' and 'js' to your website. If the directories already exist just copy the files to them
- For the pages you wish a Twitter Widget to appear, in the HTML head add the reference to the 'widget.js' and 'widget.css' files. In the HTML body add the reference to the search and/or list widget you wish to display.
- If the Twitter Widget is to be run from varying path depths, change the path references in 'widget.js' to full URI paths, for example, http://www.mydomain/css/widget.css rather than css/widget.css
Changes to the Javascript and CSS
Changes to 'widget.js' are commented within the file itself. These changes have been limited to path references to local files and one or two bugs that arose as a result of hosting the 'widget.js' file locally. The 'widget.css' has been simplified with the removal of propriety CSS. Deleting the 'Additional CSS' in the 'widget.css' file returns the CSS to near its original form.
Full Screen Mode
The 'fullscreen' option has been introduced into the search (twitter_search_param.js), and list (twitter_list_param.js), option files. The CSS has been modified so that the Widget header and the 'join the conversation' elements are displayed.
Limitations and bugs
- Only publicly available accounts and lists can be displayed
- Some users that tweet excessively or engage in too much # do not appear on the Twitter feeds. This will give a blank result in the Twitter Widget window
- The Javascript 'document.write' does not work for HTML served as XML, the Twitter Widget fails to render if HTML pages are served in XML mode
- There is a bug with the way that Microsoft Internet Explorer handles fade transitions with opacity in regards to font rendering. The result for small font sizes is a ragged, half rendered effect. In full screen mode where the font sizes are larger, this bug is less obvious. For a fix, ask Microsoft to refrain from 'enhancing standards'?
This work is offered 'as is'. Unfortunately, constrains of time and inclination prevent the offer of support...
License
This document is free to use and distribute under the GNU Free Documentation License.
Gary Hollands - April 2011.