Monday, July 6, 2009

Get Your Daily Stats via Twitter

So, I had some free time today and I figured I'd play around with Net::Twitter, which is a handy little Perl module for use with the Twitter API. I have to say that it's so incredibly easy to use that the Twitter integration was a lot of fun. Rather than test it myself and wait around, I've added the feature to the repository today and it's now available on the live site. It's always fun when stuff works out so well that you can go from an idea to production on the very same day!

The summary tweet is a count of your hits + unique hits from the previous day. It's sent to you via direct message, so it's private and does not appear in your timeline.

Here's what you do to activate this new feature:
  • Follow me on Twitter (so that I have permission to send you direct messages)
  • Log in to the WunderCounter
  • Choose Twitter from the Options menu
  • Enter your Twitter username and set Send Daily Tweet menu to yes
  • Click the send test now link.
  • If there is no error and you get a test message from me in your account, you're all set. If you have problems getting going, please get in touch with me via the usual methods
That's it! You'll get the message sometime after midnight CST. Probably within the hour, after all of your daily data has been aggregated. The amount info is obviously limited because of Twitter's format, but I think it could be a handy way of tracking your stats, especially if you're on the go and/or haven't had a moment to log in and check your stats on a given day.

So, let me know what you think. If there's some interest, there are other places Twitter could be used in the application. For instance, getting a Tweet when a certain IP address hits your site might be a worthwhile addition. Another use may be to create a custom schedule of tweets throughout the day when you'd like to be updated on your stats. For example, you could get your summary info sent at 9:00 AM, 5:00 PM and 10:00 PM. Those are just some ideas I've been playing around with, but I'm always open to suggestions, so keep them coming in.

2 comments:

Tricia said...

I don't see this under the Options menu . . . do you have to have a premium account in order to get this feature?

test said...

@Tricia: You need to have either a Premium or an Invisible account. "Twitter" is on the "Options" menu. It's near the bottom, between "Time Zone" and "WunderLink". To be clear, it's on the dropdown "Options" menu and not on the "Account Options" page, which is also an item of the "Options" menu. I hope that makes sense. Please let me know if you have any difficulty getting the Twitter DMs enabled.