Great Website Design for over 10 years

Customer Comments
I am thrilled with my new website. With regard to the service provided to me from Webselect, I cannot fault it.
Read more commentsIntegrating Twitter with SelectCMS, Part 1
By Mark Bell, Web Developer
You’ve probably heard of Twitter by now; after all, it’s been everywhere in the news, both on the web and in traditional media. Social networking sites such as Twitter and Facebook have gradually become a vital part of web marketing. As a site owner, these sites are a great way to connect personally with both existing and potential customers and to allow them to stay informed about your web site.
Our SelectCMS content management system allows site owners to update their Twitter followers on new content and products, directly from within the system (and complete with an automatic link to the new or updated pages). Today, and in a future post, I’m going to talk about how we developed this feature, and perhaps shed a little light on how much is actually involved in adding something so seemingly straightforward.
The first step is to find a way to allow SelectCMS users to update Twitter without leaving the CMS itself. Twitter already has a public API (Application Programming Interface) which allows for external applications and web sites to access and update it’s data.
We need some additional software to ‘translate’ between Twitter and SelectCMS (which is written in C#). Fortunately, the clever folks at DimeBrain recently released TweetSharp, which is an open source .NET library allowing our code to communicate easily with Twitter through it’s API. So far so good!
The next hurdle is authentication: when you post updates on the Twitter web site, it must know who you are in order to attribute those updates to your account, so you are asked to log in with a username and password. Somehow, our CMS must perform this authentication automatically, in order that the site owner doesn’t have to re-enter his/her Twitter details every time they want to send an update.
We accomplish this using a system called OAuth, which is a method of authentication designed so that users can grant external web sites and applications (in this case SelectCMS) access to their Twitter account, without those applications storing their Twitter login details. It works like this:
- The site owner visits the Configuration page in SelectCMS and clicks ‘Enable Twitter Integration’.
- If we don’t already have an Access Token (a long string of random characters, unique to this user and account) stored for the site owner, then they are redirected to the Twitter site, where they enter their Twitter user name and password.
- When these details have been entered, the Twitter site sends back a Request Token (a long string of random characters) to SelectCMS.
- SelectCMS then sends this Request Token back to Twitter, along with some other information identifying itself.
- In exchange, Twitter sends back a unique Access Token to SelectCMS, and grants it access to the user’s Twitter account. The Access Token is like another form of password for the Twitter account, and is stored in the SelectCMS database.
- From now on, this Access Token is all we need to post updates; the user never needs to enter their Twitter details again.
So there we are – quite a lot to think about, just to put 140 characters on a web page! Next time I’ll talk about one final problem we had to overcome and how we integrated all this into the SelectCMS system.
If you’d like to discuss adding Twitter integration to your site, please email us or give us a call on 01626 855400.
Want to comment on this? Email us at info@webselect.net


