Hello all,
After talking to Nisse Bryngfors, he requested that the URLs in tweets would automatically be made as urls and marked up with anchor tags. In addition to this he requested that @username replies were also automatically generated into anachor tags.
For example:
check out this site http://google.co.uk Nice design @warrenbuckley
would now become
check out this site
http://google.co.uk
Nice design
@warrenbuckley
This has been made possible with a new function in the XSLT Extension CWS.Twitter called FormatURLS.
So to format your tweet use this syntax in your XSLT.
I have reposted the instructions below for people who didn't use my previous version.
This package installs the following files:
- bin/CWSHelperTwitter.dll
- xslt/CWS_twitterStatus.xslt
- /usercontrols/Installer/CWSTwitter/cwsTwitterInstaller.ascx
The installer usercontrol cwsTwitterInstaller.ascx is used to modify the /config/xsltExtensions.config
to setup my custom XSLT extension to allow us to modify the strange format of the twitter date format.
The actual package installs the following into umbraco:
- Macro: [XSLT] CWS:Display Twitter Status
- XSLT: CWS_twitterStatus.xslt
To use this package just install this package, to do this take the following steps.
- Login to umbraco
- Goto the Developer section
- Right click the Macros node
- Select Import Package
- Press Browse and find the zip package file you have downloaded
- Follow the steps in the wizard
- Once installed insert the macro into your XHTML template
- Insert your twitter id (not username), the number of items you want to display (upto 20) and check the box if you wish to include your friends tweets.
How do I find my Twitter user id?
You can find your twitter id by browsing to your twitter page, for example http://twitter.com/warrenbuckley and clicking on the RSS link at the bottom of the page. Which loads your RSS feed like this, http://twitter.com/statuses/user_timeline/9751992.rss
So in my case my Twitter user id is 9751992
Customisation
To customise the XHTML for the tweets display take a look at the XSLT file installed. This should be easy to read and edit, it is possible to modify your XSLT to include more things from the XML that twitter returns to us. How about the users real name, the users site it's really upto you?
Check out the example XML files
http://twitter.com/statuses/user_timeline/9751992.xml
http://twitter.com/statuses/friends_timeline/9751992.xml
Download
So without further-a-do here is the package for you to download.
Download Creative Website Specialist - Twitter Package v1.2.0