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
ruby, Technology

Flex Remoting in Ruby? Easy Choice.

I’ve had a rocky relationship with Adobe Flex.  An awkward attempt to migrate an existing app to Flex caused several strong reactions and cost a good bit of developer goodwill.  The details of that decision are messy and irrelevant.  The experience sucked.

On the other hand, I could not have built the FeatureFrame technology without Flex.  There’s no simpler way to build a widgetized video player with embedded applications.  The same pains of horrible documentation, irrational design decisions, insidious bugs, and painful workarounds remain, but the things it makes easier pale in comparison to the obstacles of any other approach.

And of course in building a virtual world such as Elf Island, Flex is an obvious choice if you want to play it in the browser and build maintainable code (binary Flash files make a poor foundation for a sustainable product).

For most languages you might want to build a Flex app in, free, open options are available.  I had a recent need to prototype a solution that might also turn into a test fixture for our vendors to use in producing Flash apps, so Rails seemed the natural solution for simplicity of deployment and prototyping speed.

The main choices to support Flex Remoting calls in Ruby are RubyAMF and WebORB.

In trying to decide, I encountered a very useful comment in this thread:

"The biggest difference between what WEBorb provides and what RubyAMF(only
AMF alternative I am aware of) provides is workflow.  Weborb is a great
product written by guys who do java primarily.  So it follows the patterns
of having a Service layer that connects you to your application.


RubyAMF is written by a ruby developer."

Immediately, I know what my choice is.  WebORB is obviously the trap of over-architecture and suffering that pervades “correct” Java development.  A quick search on how to use RubyAMF (in a controller) confirmed my suspicions:


respond_to do |format|
format.html # index.rhtml
format.xml { render :xml => @people.to_xml }
format.amf { render :amf => @people }
end

When I see code like this and compare it to the WebORB or GraniteDS implementations, I just can’t imagine choosing those other paths.

Rails + RubyAMF is concise, clean and obvious in what it’s doing.  Yes, please.

Java, Technology

Outsource the Scaffolding

Just today, I twittered a link to an insightful blog post, “Here’s the Deadliest Catch: Hiring an Agency to Build Your Startup”.  The title is largely self-explanatory, and I may blog my own riff on it at a later date.  Digg is often raised as a counter-example to outsourcing development of a startup, with version one developed for $200.  So how do you decide what the right balance is for you?

Ruby on Rails has this concept of “scaffolding“, which makes it trivial to get a simple web application running to perform create/read/update/delete operations on a simple business object.  So if you wanted to build a basic address book, Rails could basically create that application with a one line scaffold generate script.  It produces a simple web interface, and handles all of the database calls for you.  Java code to accomplish the same task is typically more verbose, but even if you wrote it from scratch in any language, it would be fairly intuitive for an experienced developer with no knowledge of your business to immediately understand the app and how to extend and maintain it.

At some point, almost any app becomes more complex.  The current version of Digg could not be developed for $200, and I dare say it would be foolish for someone like Digg to build an application of its current complexity completely contracted out.

I’ve been in startups all along the continuum, and made transitions between different mixes of internal versus external product development and infrastructure.  My current opinion is to outsource the scaffolding.  If you’re deploying a java/tomcat/MySQL app on a plain vanilla linux distribution, you can probably have a contract sys admin put that together for you – any other competent admin can look at how it’s configured and fix your problems.  When you start depending on all sorts of custom extensions, configurations, replication, huge scale, and/or DB sharding, it’s probably time to hire some admins that can own that custom knowledge you depend on.

The same thing goes for product development.  Are you building out a marketing web site?  An app that could be built with Rails scaffolding?  Contract it out – good contractors will realize how easy it is and crank it out for cheap (though maybe more than $200).  Most capable software developers you would hire or have hired don’t want to build or maintain that stuff anyhow.  Save internal development for the custom, proprietary stuff you need to spend time on, the meat and potatoes code that differentiates your application from everybody else’s.  The stuff that will take even a good developer more than a couple of hours to really comprehend.  Start throwing the switch to internal resources when it starts to get complicated – you’ll be much happier.  Trying to insource knowledge of a complex application that’s already been written by someone else is doable, but quite a challenge.

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