thingelstad

Jamie Thingelstad's personal website

Month: March 2009 (page 1 of 4)

Flight Control – Great iPhone Game

This last weekend I grabbed a copy of Flight Control for my iPhone. It looked like the kind of game that I can get into. I like puzzle style games and have an affinity to 2D-gaming over 3D-gaming. I was pretty much immediately hooked.

The premise of Flight Control is simple. You have a top-down perspective of a landing field and you have to draw flight paths with your finger for each plane to land. There are different types of planes that fly at different speeds. Over time, the planes come faster and faster.

Flight Control Gameplay.png

The game is addicting. I’ve now got a high score of 57 but am stumped how you get much past that.

Tracking Twitter Followers with Cacti

Two weeks ago I was one of the guests on Midmorning on Minnesota Public Radio for a show about Twitter. The result has been a lot of conversations lately about Twitter. I was intrigued to see how many people had started following me from the show and before you knew it I felt the absolute need to see Twitter follower graphs in my favorite graphing tool, Cacti. I did a quick search and was surprised to not find anyone doing this already.

As with anything Cacti-related there was a lot of trial and error to getting this working, and I’m positive smarter people than I can do this with much more elegance, but I got it working good enough for me and the output is pretty slick.

If you’d like to join me in graph-tastic, RRDtool, Twitter navel gazing here is how. And I do know there are services that do these graphs, but I don’t believe any of them do anything more than daily counts. This samples every 5 minutes.

detail-thingles-followers.png

I figured I’d do this in Ruby just to make the Perl lovers in the crowd uncomfortable. At first I tried to use the Twitter4R gem to get to the Twitter API but that had issues, mainly it couldn’t deal with paging in the Twitter API and thus just returned 100 followers. Instead, I went straight to the Twitter API and found a better call in the social graph functions that just returns the id’s of people you follow or follow you. Less data, lighter, and no paging! Yeah! Here is the incredibly simple code that we’ll use to get Cacti the data it wants. All the comments will make this easy to follow. :-)

require 'rubygems'
require 'open-uri'
require 'json'
 
def get_count(url)
	buffer = open(url, "UserAgent" => "Ruby-Wget").read
	result = JSON.parse(buffer)
	return result.length
end
 
def get_follower_count(user)
	url = 'http://twitter.com/followers/ids/' + user + '.json'
	return get_count(url)
end
 
def get_friend_count(user)
	url = 'http://twitter.com/friends/ids/' + user + '.json'
	return get_count(url)
end
 
followers = get_follower_count(ARGV[0])
friends = get_friend_count(ARGV[0])
 
puts "followers:#{followers} friends:#{friends}"

Note that all this does is output one line that looks like this:

followers:464 friends:117

Cacti uses a simple name:value format to parse output from shell scripts. This little bit of Ruby does have some Gem dependencies, mainly a JSON library to parse the mess we get back from the API calls into something that Ruby likes.

This script takes the username as a command line parameter. This is so you can multiple twitter accounts in Cacti. Not only can you gaze at your own navel, but you can gaze at your friends navels too!

Let’s get to the point and show what the win is for this before we go through the Cacti configuration stuff. Here is the simple graph that we can use to track follower and friend counts over time.

graph_image.php.png

I didn’t create Cacti templates for any of this, if you want to set it up yourself here are screen shots of the setup.

Continue reading

Twouble with Twitters

Current just posted a video mocking the “twittersphere”. Well done, and pretty funny too. :-)

Of course I saw this via mkortekaas on Twitter. Hmmm…

I Love You, Man

Tammy and I went to I Love You, Man tonight. Pretty funny. It was exactly what you would have expected. Light. Simple. Funny.

Twitter and Onions

garrickvanburen: @PhilipHotchkiss @cullect has shown me that indexing, archiving, and ranking tweets has much in common with peeling an onion.

thingles: @garrickvanburen does that mean it makes you cry? :-)

garrickvanburen: @thingles -more often than I’d like :)

Yo-Yo Ma

I went looking for some nice music for this morning and wasn’t finding anything in my collection. I grabbed Yo-Yo Ma‘s Bach: The Cello Suites album off of iTunes. It was a great choice.

View-Master

I was flipping through the March 14th copy of The Economist and ran across “The final reel” story. Fisher-Price is no longer going to make the View-Master. It was an odd article. I felt rather sad. I think because I distinctly remember as a little boy looking through my own View-Master and being amazed at the images and also completely obsessed trying to figure out how it worked. The experience continued this summer as Mazie enjoyed looking at her very own View-Master.

Going forward kids will only be able to get reels of animated characters and other licensed, copyrighted characters for the View-Master.

Milk

Tammy and I watched Milk tonight. It was a great movie. The story of Harvey Milk is amazing. Great acting by Sean Penn.

Kopplin's Espresso

Espresso done right at Kopplin’s Coffee.

Willie and the Wheel

I got this album about a week ago and have been really enjoying it. Willie Nelson. Texas Swing. You can’t go wrong!

Older posts

© 2014 thingelstad

Theme by Anders NorenUp ↑