Integrating a website with twitter

February 9, 2009 at 11:51 am | In Blog, Website Development | 2 Comments
Tags: , , , , , , , , , , , , , , , ,

As part of the continuing campaign to take over the internet I’ve been looking at twitter integration for DirtMind.com. I’m a big fan of twitter (follow me @dirtmind) so I’ve been wanting to do something with it for a while.

There are a number of natural touchpoints with twitter that I looked at:

  1. Tweeting DirtMind top stories
  2. Allowing registered members to list their twitter account in their profile
  3. DirtyThoughts – anonymous, uncencensored tweeting to the @dirtythoughts account

I’ve now achieved all of these. Tweeting top stories wa the easiest and is done using twitterfeed which lets you tweet from an RSS feed. Using twitter feed I can send out both new entries on this blog (or at least those tagged with the “blog” tag like this one) and also the top stories from the DirtMind RSS feed (a custom feed I built on my top stories database entries).

Allowing registered members to list their twitter account was on the surface quite easy. I wanted to let people enter their twitter username in their profile info and then show up a little blue “t” next to their posts and in their public profile view that links to their twitter feed. Just the way the site already does for msn, icq etc. Once I started looking into this though it quickly became apparent that it was quite a bit of work, so in normal style I thought that someone else must have already done this fairly obvious site modification. The advantage of using a popular system as your base architecture is that you can make use of the cool modifications everyone else has done. I found and implemented RMcGirr83’s phpbb3 twitter mod with no modifications (other than changing the icon) which is a first for me as I normally modify modifications and then modify those until I’m recursing into a black hole. Anyway, it’s excellent and does exactly what I wanted. You can see an example on my public profile listing at DirtMind.

Finally, DirtyThoughts… I liked the idea of anonymous tweeting as a way of people getting something off their chest, expressing themselves or saying something they wouldn’t normally say, and the ability to comment on these dirty thoughts and discuss them. Well forum software is built for commenting and discussing so a cool thing to do would be to have a setup whereby people could enter in a comment and it would get sent to both the forum and twitter. Using the twitter API was simple enough, so I designed a twitter page for @dirtythoughts, then created a DirtyThoughts user on the DirtMind site. Now I just needed a way to show the latest thoughts. To do this I butchered the standard viewtopic page (sorted by latest first) and customised it to have the dirtythoughts posting form at the top. It works really well :D I also edited the forum and thread navigation pages to automatically redirect to this special viewing and posting page rather than the normal phpbb3 pages. You can see the result here. It works really well and is already attracting some interesting and disgusting anonymous tweets! Please stop by and add one yourself :D

The hardest part of all of this was getting the visual confirmation stuff to work on my new page as I’d not gone anywhere near that stuff before. Some of the interesting bits I came accross were:

How to sent a message to twitter using php

How to submit a post to phpbb3 by a different user

2 Comments »

RSS feed for comments on this post. TrackBack URI

  1. [...] am | In Blog, Website Development | Tags: anonymous, code, parser, php, twitter, xml As part of the Integration of DirtMind with twitter I needed to send tweets to twitter from php to the anonymous [...]

  2. [...] February 9, 2009 at 11:51 am | In Uncategorized | Tags: anonymous, code, php, phpbb3 As part of the Integration of DirtMind with twitter I needed to be able to submit posts into my phpbb3 forum using a bot [...]


Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.