Atlanta, ruby, startups, Technology

Why I created Badgy

Saturday afternoon, I announced the creation of Badgy at http://bad.gy/.  Simply put, Badgy is intended to be a social game for Twitter (@BadgyApp) that fits naturally with how people already use Twitter.  I’ve referred to it as a “native” app, which means that it’s written around the capabilities of Twitter, not copied from some other game that worked on Facebook.

If you haven’t used Badgy yet, just mention “badgy” on Twitter to get started and get some context for the rest of this post.

Initial feedback has been somewhat mixed but overall encouraging.  Some users disagreed with the retweet required to earn the second badge.  Some people just don’t get it.

It seems helpful at this moment to reflect on why I created Badgy, and why it’s built the way it is:

  • Fred Wilson wants gamesin a recent blog post, New York VC and Twitter investor Fred Wilson reflected on the state of the Twitter platform and what sort of apps might succeed on Twitter.  Many of these areas, such as enterprise, discovery, and analytics represent areas where Twitter could either create or acquire a single company to cover the gap, but he also mentioned social games.  The problem with social games on Twitter is that…
  • Current Twitter Games Suck – “popular” games like Spymaster motivate you to follow people you aren’t friends with and tweet things your friends don’t care about.  In essence, they are Mafia Wars clones that are too invasive and render your Twitter account useless.  Fun!  A proper Twitter game should be compatible with how people already use Twitter.  (FourSquare doesn’t count as a Twitter game – it is a mobile app game that uses Twitter as a promo channel.)  Although ever so slightly intrusive, asking users to mention “badgy” on Twitter to begin playing is totally native and much less awkward than going to a web site to join a Twitter game.
  • People Love Badges – Look at FourSquare badges, Facebook game bragging opportunities, or achievement systems in console games and you’ll see that people LOVE to feel like they’ve earned something and can brag about it.  Using badges as the basis of a Twitter game seemed totally natural.  Someone I follow on Twitter once said that they wished Twitter would give them some recognition for tweeting exactly 140 characters.  I’ve often felt the same way.  Something like Badgy can do that, and recognize many other interesting Twitter actions that are totally natural to Twitter but still fun to recognize.
  • Twitter Integration – I wanted to learn how to integrate with Twitter.  The combination of the tweetstream and twitter Ruby gems made this easy.  The ease and power of Twittter’s APIs gives me new respect for Twitter’s platform team.  It takes literally 3 lines of Ruby code to receive near real-time notification of every Tweet matching a set of keywords, leading to a fast…
  • Fast Minimum Viable Product – it was relatively easy to find people who mentioned “badgy” and reply to them, giving them a badge.  It was not easy to check the Tweets of a bunch of individual users and see what else they said, which is why the Square One badge is given when you retweet the message giving you the Badgy badge.  Sure, the retweet promotes badgy, but it was also easy to search for that unique phrase, retweeted, rather than starting to follow individual users.  The badge requiring a retweet is a bit intrusive, and will not be a key pattern for future Badgy badges.
  • To learn – Game mechanics and basic motivation tactics aren’t just part of games, they are a useful ingredient for almost any software.  Badgy itself may become a vibrant game, or it may serve to teach lessons that make other games and applications I write better.  If nothing else, Badgy provides an avenue to rapidly test and measure theories about what does and does not work in social games on Twitter.
  • Fun – It’s fun to make games and watch people react to them
  • Potential Business – on top of all of the other reasons, there are actually some interesting applications of the technology that would be needed to fully build out Badgy.  Time will tell.

A couple of obvious questions have been asked:

  • Why nag people to retweet their first badge? – This decision was part technical compromise, part promotional decision, and part social experiment.  It’s difficult to rapidly scale following individual users.  It’s easy to track keywords.  This decision helped launch Badgy sooner.  I was also curious what types of Twitter user would be willing to retweet our Tweets to their audience to get a virtual badge.
  • Why only 2 badges? – It’s enough to prove the idea.  Get people to “sign up” by mentioning the fairly unique keyword “Badgy” on Twitter, and see how many people would respond to a request to retweet to earn another badge.  Some people are willing to incorporate Badgy into their Twitter behavior.  Badge #3 will be less obtrusive.

I hope that you will give Badgy a try and give feedback and suggestions on what you’d like to see next.  I hope we see more Twitter games that don’t suck.

Advertisement
Technology, Uncategorized

Create TinyURL like URLs in Ruby

Some Ruby on Rails side-project hacking I’ve been doing led me to need to generate shortened URLs.  The ShortURL gem is fine if you want to use TinyURL, Snurl, or some other external service to generate and manage your URLs, but in my case, I need to host the URLs so I can track usage statistics and redirect to a URL determined at request-time.

I wanted to avoid generating curse words, or any words for that matter, so I opted not to use vowels rather than try and figure out something more clever.  I also had no requirement to obfuscate the sequential nature of the generated value.  The result essentially converts a number to a base 54 string suitable for use as a URL parameter.

URL_CHARS = ('0'..'9').to_a + %w(b c d f g h j k l m n p q r s t v w x y z) + %w(B C D F G H J K L M N P Q R S T V W X Y Z - _)
URL_BASE = URL_CHARS.size

def generateUrl idNumber
localCount = idNumber
result = ”;
while localCount != 0
rem = localCount % URL_BASE
localCount = (localCount – rem) / URL_BASE
result = URL_CHARS[rem] + result
end
return result
end

My usage will be to convert the numeric primary key of my model objects to this hash, so that Person #1174229 could be referenced as the short url http://app.com/p?i=7sH_

Obviously, the straightforward business of inserting this value into your table, performing lookups on it, etc is omitted and should be fairly straightforward to a seasoned developer.  The function can fit almost a half-billion values into 5 characters, and doesn’t experience the stack overflow issues of some recursive implementations I found, so I think it’s pretty useful.  (7 characters give you 1.3 trillion possibilities… nice!)

I can see a pretty cool plugin being built to solve this problem… maybe I’ll get around to writing short_url_fu one of these days.

Technology

RubyOnRails.org hacked?

In trying to update my Ruby gems today, I got some strange errors.  Upon navigating to the Ruby on Rails site, I saw the following:

So what’s the word?  Did the main Ruby site get hijacked or expired?  If so, this could be yet another obstacle to enterprise adoption of Ruby/Rails.

Update: This post has been posted to Digg, and comments there indicate that the RoR IRC channel has acknowledged an issue with the domain, and they are “looking into it” (i.e. – 37 Signals is calling their lawyers).