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

Aaron Brazell

Aaron Brazell is a Baltimore, MD-based WordPress developer, a co-founder at WP Engine, WordPress core contributor and author. He wrote the book WordPress Bible and has been publishing on the web since 2000. You can follow him on Twitter, on his personal blog and view his photography at The Aperture Filter.

13 thoughts on “The DCTwits Twitter Group

  1. 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. 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.

  3. 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!

  4. 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.

  5. 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

  6. 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.

Comments are closed.