Technosailor.com Readers! Donate today to assist the Internews Haiti Earthquake Communications Effort in their efforts.

14 January 2008 13 Comments

The DCTwits Twitter Group

Real quick post here to let you know about the DC Twits Twitter user group. I set this up this weekend (first foray into Twitter API and it wasn’t too hard) for people in the Washington, D.C. metro area who want to subscribe. That doesn’t preclude anyone else from participating – for instance Brian Layman from Ohio and Stuart MacDonanld from Toronto both are in the group (for what reason, I have no idea but glad to ahve them along, nonetheless!).

It’s a simple concept. Follow @dctwits in Twitter and any message you send as a direct message to dctwits (e.g

1
d dctwits hello world!

) from your Twitter account will be blasted out to everyone else following dctwits.

I’m tweaking things here or there as we go along (for instance, I made links clickable earlier), but it seems to be working. I’m thinking Boston needs a Twit group and I’d be happy to set up another instance for them (or any group – within reason) or anyone. Just give me a shout.

Update: I’ve released the code to the public. It is licensed under the GPLv2 License so feel free to use but keep the attribution notices in place. You must, at this time, have PHP 5.1+ or the PECL Json module loaded in PHP. You can download the code via SVN here: http://metro-twitter-groups.googlecode.com/svn/trunk/

1
svn co http://metro-twitter-groups.googlecode.com/svn/trunk/ twittergroups

Pick up your copy of the WordPress Bible, a wildly popular resource for beginners and experts alike.

Popularity: 1% [?]

Tags: ,

13 Responses to “The DCTwits Twitter Group”

  1. dave holland 14 January 2008 at 5:26 pm #

    I was wondering what client library you used? I have been meaning to experiment with Twitter4R as I have heard very good things about it (for Ruby) from 4 other developers I know well. Let us know your experiences with client libraries and what language you used?

    thx

  2. Aaron Brazell 14 January 2008 at 8:48 pm #

    Dave, I use PHP. I found a Twitter client class written by David Billingham. I took it and modified it. For instance, his class uses XML. Mine uses JSON, though I will build XML back in as an option. The code is released now.

  3. Carlos Granier-Phelps 15 January 2008 at 1:04 am #

    I’ve setup a Twitter Group for Miami, FL. You can find it at:

    http://twitter.com/MiamiTwits

    Just follow it and send direct messages to it to broadcast to the entire group.

  4. Jill Foster 17 January 2008 at 7:55 pm #

    Thx Aaron-the-technosailor for organizing this and investing the time. -Proud to be a DCTwit!

  5. Eric Blair 21 January 2008 at 12:34 am #

    I’ve noticed some people are sending @msgs to DCTwits. What do you think of sending at DM containing the sending directions to anybody who sends an @msg to DCTwits? This would obviously add 1+ API request to each load, so it might not be worth it. Curious about your thoughts.

  6. Aaron Brazell 21 January 2008 at 2:01 am #

    Yeah, I have very little overhead on API right now so I’d prefer not. I think most people follow people individually anyway.

  7. lft411 17 May 2008 at 10:45 am #

    Tried setting this up as it appeared pretty simple. Copied the files over to my linux box running php 5.2.5 in the following location:

    /home/lft411/www/twitter/

    Three files located there. I renamed the config file and edited it.

    For testing I set my twitter account to follow the “lft411″ twitter account, and the lft411 account to follow me.

    From my twitter account I sent “d lft411 hello world!”

    I don’t see anything show up on lft411 nor my twitter account but it sent.

    Since I have not setup the cron function yet I simply accessed the index.php via the web thinking that should accomplish the same thing right? The idea of the cron job is just to automate the process right?

    I am missing something here, would love to get this working for the local community.

    Thanks!

  8. lft411 17 May 2008 at 10:59 am #

    I enabled the debug and I notice the following:

    Fatal error: Call to undefined function: date_default_timezone_set() in /home/lft411/public_html/twitter/index.php on line 22

    The timezone is set in the config.php file so I am not sure.

  9. Aaron Brazell 17 May 2008 at 9:01 pm #

    This function is a PHP function available in PHP 5.1 or greater. While my posts states you must have PHP 5+ I’ll update it to reflect 5.1.

    PHP Reference date_default_timezone_set()

  10. Andrea Hill 19 May 2008 at 1:40 pm #

    Thanks for your work on this! I haven’t delved into the code too much, but I was wondering about the “acceptance” of posters. Does DCTwits need to mutually follow someone for messages to be transmitted? Is that something you are handling manually?

    thx
    Andrea

  11. Aaron Brazell 19 May 2008 at 1:54 pm #

    Andrea-

    It’s setup now to autofollow anyone who follows @dctwits. This is to ensure that you are able to send DMs to it, as that is the required method of posting to the group. There is an up-to 4 minute delay for this to happen and you get an email notifying you when DCTwits is now following you. The delay is due to the need to stay within the 70 Twitter API requests per hour. Everything the bot does costs an API request.

  12. Brian Eisley 13 June 2008 at 12:16 pm #

    Hi, Aaron. Thought I’d let you know that I’ve used your code to create an unofficial Twitter group for the 2008 Annual Conference of the American Library Association. The account is at:

    http://twitter.com/ala2008

    I have the code hosted on my own site and run by a commercial cron scheduler (WebBasedCron). It seems to be running beautifully.

    Thank you so much for doing this and putting the code out there!

  13. Brian Eisley 13 June 2008 at 7:07 pm #

    Whoops, I hosed the link to WebBasedCron in my comment. I knew I’d mess something up! :-)