Created
March 4, 2009 17:16
-
-
Save jerodsanto/73911 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/ruby | |
require 'resolv' | |
require 'rubygems' | |
require 'rb-skypemac' | |
include SkypeMac | |
def set_location(loc) | |
Skype.send_ :command => "SET PROFILE MOOD_TEXT #{loc}" | |
end | |
if `ps aux` =~ /Skype/ | |
external_ip = `curl http://my-ip.jerodsanto.net 2>/dev/null`.chomp | |
case external_ip | |
when Resolv.getaddress("sant0sk1.homeip.net") | |
set_location("at Home") | |
when Resolv.getaddress("rsd-mcc.homeip.net") | |
set_location("at MCC") | |
when "68.15.235.89" | |
set_location("at HM") | |
else | |
set_location("Out") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment