Free Financial Times Subscr. for Facebookers

Posted on March 06, 2008

Financial Times is going to be giving students (apparently you really do have to be a student, what about those of us who are students of the school of Hard Knox?) free subscriptions to all who want. The subscriptions will only last for a year at a time, but those interested will be able to renew the subscriptions for free for up to 4 years.

I can’t say I read the mag (because I don’t) but I wonder if this can be seen as getting a kind of free financial education of sorts.

Hooray for free Joyent Accelerators!

Posted on January 14, 2008

So I finally got accepted into Joyent’s “free Accelerator’s for Facebook appications” program. I plan on documenting working through a Facebook app with Rails from beginning to end in this big push to relaunch this site. I may even release the source code too but that more or less depends on how “generous” I’m feeling. Oh and by “generous” I mean if more than 2 people read that post and actually want the source or not. We’ll see.

Also, If there are any other aspiring Ruby/Rails/Human Facebook devs out there interested in Joyent’s free Accelerator program*, you should know that it took me a few weeks to of waiting to get my account. Your time could be longer or shorter depending on demand. I personally was expecting something a little quicker and despite my inner-pulling to let you feel the same patience-pain I felt, I decided it was my duty as a decent netizen to let you know. So, enjoy!

  • - free for one year of course ;)

Rails tip of the Day (#2, new style for Facebook user invites)

Posted on November 26, 2007

ok, so i know i said i was going to continue with routes with my next tip post, but to be honest, I almost fell asleep just trying to plan the post out. Needless to say, my heart really wasn’t in it. So instead, here’s a facebook developers tip!

Recently-ish Facebook made it loads easier for app developers to add “invite your friends!” functionality into your app and since they don’t have any examples of how to use it in Rails, here you go.

First with the action in the controller, I grab all of the friends of the current user and pull out the ones who already have the app installed

    def invite
    fql =  "SELECT uid, name FROM user WHERE uid IN" +
        "(SELECT uid2 FROM friend WHERE uid1 = #{@current_user.fb_user_id}) " +
        "AND has_added_app = 1" 
    xml_friends = fbsession.fql_query :query => fql
    @friends = Hash.new
    xml_friends.search("//user").map do|usrNode| 
      @friends[(usrNode/"uid").inner_html] = (usrNode/"name").inner_html
    end
    @friend_ids = []
    @friends.each do |uid, name|
      @friend_ids << uid
    end
    @friend_ids = @friend_ids.join(',')
  end

now for the view, here is the fbml I stuck in my canvas page (notice the using of the @friend_ids in the exclude_ids paramter, sneaky sneaky)...

    <fb:fbml> 
    <fb:request-form action="<%= facebook_send_invites_path %>" method="POST" invite="true" type="social gamer" 
                    content="social gamer is the best app for gamers who actually game! 
                    once you join, you can rate games, review games and even loan out your games to 
                    your friends. <fb:req-choice url='http://www.facebook.com/add.php?api_key=724faa99b85cde63ed19088ca917e482' label='check out social gamer...now' />"> 
    <fb:multi-friend-selector showborder="false" actiontext="invite your friends to use Social Gamer...now" exclude_ids="<%= @friend_ids %>"> 
    </fb:request-form> 
  </fb:fbml>

yeah, hawt innit? now sure the controller code can be refactored (like only parsing out the uids probably instead of the actual users), but this is what I was able to just convert from the old code I had. If I think the refactor is good enough after I dig back into the xml I have to parse I’ll post it but this should be good enough to get you started. Also note that I’m using rFacebook here which I believe now depends on hpricot so you’ll need at least those two gems to do this.

You can dig more into the fb:request-form tag on the facebook fbml wiki page