24 Oct 2007

automating facebook

24 Oct 2007

So Facebook has been taking up lots of time, especially with all its funny (and fun) applications. One app that’s been taking most of my time is Warbook, which is a simple but addictive web-based MMORPG game that’s linked to Facebook.

One of the spells that you can cast in Warbook is Alchemy, which basically spends 20 mana to produce a good amount of gold. A normal player gains 6 mana each hour, so that means you can cast Alchemy every 4 hours. Problem is, my mana cap is low at 60, and if I leave the game for too long I’ll end up with lots of wasted mana. It’s not like WoW where you can actually drink and stuff to regain mana; you actually have to wait to get it replenished.

That’s when I found this Automating Facebook Interaction using Ruby and WWW::Mechanize article, showing an example of how you can automate posting to someone’s wall with random quotes. Since then, I’ve extended the example to cast Alchemy for me. Put it together with cron, and I have it running every 4 hours. ^o^

Read up a bit more on Ruby’s syntax, and now I have daily runs to use up my Vampires attack quota, and do 20 random attacks on Vampires vs. Werewolves. Yeah, they’re silly apps, but me like RPG styles stuff. 😛

Still a bunch of quirks to work out though. Facebook connections hasn’t been so good lately, and there’ve been disconnects while the scripts are running. I’ll probably get to that sometime, but not so soon.

Leave a comment
More Posts
Comments
  1. Richard V November 1st, 2007 6:46AM

    Hey man, do you have that script to hand for casting Alchemy? I’m very new to Ruby and I really don’t know where to start!

  2. myuu November 1st, 2007 10:04AM

    sure, here’s the url:-

    http://www.bangsar.net/ruby/mechanize_wb_alch.rb

    you’ll need to add your email and password on line 55. 🙂
    and mind you, this script will log you off Facebook.

    as for starting with Ruby, i guess you’ll have to install Ruby first, then install Mechanize and stuff as per the original tutorial. i use FreeBSD, so i can install both from /usr/ports/www/rubygem-mechanize. might be a bit more tedious on windows…

  3. Richard November 1st, 2007 9:02PM

    Thanks 🙂

    And will this work on Rails? I could most likely run it on my Mac as that’s (some form of) BSD but its a laptop! Much rather run it on my server. Will Rails understand the script?

  4. myuu November 2nd, 2007 2:18AM

    i’ve no idea honestly. never touched Ruby before this. 🙂

    the original post is hosted on some sort of Rails blog community; maybe it would work as it is.

    hope it works out for you. 🙂

  5. Shanti Braford January 4th, 2008 6:52PM

    Hey guys, glad you enjoyed the tutorial.

    Sadly, Facebook changed their login mechanism to subvert attempts at automated login like this.

    I’m sure there’s a way around it, but haven’t played with it much yet.

    http://shanti.railsblog.com/fsx-trader-broken-due-to-facebook-login-changes

    If you figure out a way to automate Facebook logins using ruby, drop me a line & I’ll update some posts. shantibraford @ gmail

    Cheers!

  6. myuu January 17th, 2008 12:32AM

    hmm, my original scripts still work. guess we’ll see what happens.

Comment

Leave a Reply