Ruby

Infinity Pool The Human Sphere Live

Posted in Projects, Ruby on March 14th, 2010 by Alan Hietala – Be the first to comment

The rollout for Infinity Pool that I discussed earlier went off without a hitch. I had some great support from the community on this one and it let me delegate the most dreaded portion of the job (for me anyways) data entry.

I decided to create a handy admin interface that lets Infinity Pool be updated without the need for a programming / SQL background. This takes a lot of the pressure off of me as there are a group of people that are able to do updates now. This is very similar to the approach I took when I was the head of Horde to the Core. Delegate and train those around you to take on tasks when they ask for more responsibility so you don’t end up burning out.

A big thank you to CserZ and Atis52 for doing a lot of the leg work and doing a lot of testing and suggesting some fantastic features to help save them time.

Infinity Pool Doing Well

Posted in Javascript, Projects, Ruby on December 30th, 2009 by Alan Hietala – Be the first to comment

Just a quick update on one of my side projects Infinity Pool. I’ve pulled it out of beta and it is now hosting 300 accounts with over 2500 army lists for the table top game Infinity created. When I started the project I figured it would be a good way to keep my Rails skills up to date I didn’t think it would still have many daily users this far after launch.

As happens with many table top games the rules are about to undergo a huge overhaul. This means much of the codebase will need to change. This will be an interesting challenge as I will need to maintain all of the current users data while adding in all of the new features that are coming due to the new armies and rules.

This should be pretty fun and some good experience. All I can say is I’m grateful I built out a full suite of tests for my code as having them will be essential to ensuring that things don’t break while the site is under heavy reconstruction.

Infinity Pool Alpha

Posted in Projects, Ruby on April 29th, 2009 by Alan Hietala – 1 Comment

If you play the table top game infinity and want to help me with some feedback on the army builder I am creating please shoot me an email (alan -dot- hietala -at- gmail.com). The version that is running now is as bare bones as it gets right now but it support army validation, a single view that contains all the important information about your army.

I hope to add in a print view either tomorrow or the day after. I only have a small bit of test data loaded into the system right now so you will only be able to add 2 ariadna units to your lists. I will get the rest of the data loaded in the next day or so.

Feel free to send feedback to my email or leave a note on the blog post. Thanks for the help!

check it out at http://infinitypool.failedsave.com.

create an account to get started. These will be wiped periodically since it is still under heavy development.

Known bugs. Removing an item from the list does not work. will fix tonight
you can add 11 units to a combat group. it should be 10.

Send Direct Message – Twitter4r

Posted in Ruby, Twitter, Uncategorized on February 12th, 2009 by Alan Hietala – Be the first to comment

I’ve been getting a lot of incoming search traffic looking for how to send a direct message using Twitter4r. Firstly RTFM if you can’t do that…

require('rubygems')
gem('twitter4r', '0.3.0')
require('twitter')
require('time')
 
login = "xxxxxx";
password = "xxxxxx";
 
#make the connection
 
twitter = Twitter::Client.new(:login =>; login, :password =>; password);
 
status = Twitter::Message.create(
   :text => 'I can\'t read RDOC',
   :receipient => 'anotherlogin',
   :client => twitter)

Hope that helps.

Twitter Bot Proof of Concept – Twitter4r

Posted in Ruby, Twitter on January 13th, 2009 by Alan Hietala – Be the first to comment

While at #geeklunch today the subject came up about spreading events via twitter but without having to follow absolutely everyone that might want to post an event. I proposed a solution of creating a mini twitter bot that would retweet anything that was sent to it via direct message from anyone on its white list. I’ve thrown together a little proof of concept and it works nicely. Took some digging as the Twitter4R documentation leaves something to be desired but it works quite nicely.

require('rubygems')
gem('twitter4r', '0.3.0')
require('twitter')
require('time')
 
#array of authorized users
@authUsers = ["alanhietala"]
login = "xxxxxx";
password = "xxxxxx";
#method to check if a user is authorized to post
def isAuthorized?(user)
 return @authUsers.include?(user);
end
 
 
 
# start main script
 
#make the connection to the bots account
 
twitter = Twitter::Client.new(:login => login, :password => password);
 
 
# get the private messages of the bot 
messages = twitter.messages(:received);
 
messages.each {|message|
  #TODO: process the message for commands
 
  #check if the sender is authorized to send messages
  if(isAuthorized?(message.sender.screen_name))
    #retweet the senders message
    status = Twitter::Status.create(
       :text => "RT "+ message.text,
       :client => twitter);
 
 
  end
 
 
  #delete the message from the server because its been processed
  twitter.message(:delete, message.id);
 
}

I’ll hack away at this some more and throw it into cron on a server some time later this week. Feel free to take this code and hack it to death.