September 10th, 2009
welby
Tagging along at lunch with a few colleagues at work today to the local subway and notice a new set of adverts on the window.

There's a Sub for that!
It appears that subway are imitating Apple’s “there’s an app for that”. It turns out that this campaign has been done by McCann Erickson and is a ‘light-hearted’ campaign complete with UK TV adverts. The phrase Imitation is the sincerest form of flattery comes to mind.

There's a shirt for that

There's a sub for that too
A quick script to send notifications from IRSSI for privmessages and also for highlights, I’ll put more commentary on later, but for now..
use strict;
use vars qw($VERSION %IRSSI);
use Irssi;
use LWP::UserAgent;
$VERSION = '0.1';
%IRSSI = (
authors => 'Welby McRoberts',
contact => 'irssi@whmcr.com',
name => 'irssi_prowler',
description => 'Sends a notification to Prowl to alert an iPhone of a new highlighted message',
url => 'http://www.whmcr.com/2009/07/irssi-prowl-notifications',
changes => 'Friday, 10 Jun 2009'
);
######## Config
my($PRIV_PRI, $PRIV_EVENT, $HI_PRI, $HI_EVENT, $APP, $UA, $APIKEY);
$PRIV_PRI = 2;
$PRIV_EVENT = 'Private Message';
$HI_PRI = 1;
$HI_EVENT = 'Highlight';
$APP = 'irssi';
$UA = 'irssi_prowler';
$APIKEY='7b5d817bd95911b4c049e3034dcf7a96dfa3fb53';
########
####### Highlights
sub highlight {
my ($dest, $text, $stripped) = @_;
if ($dest->{level} & MSGLEVEL_HILIGHT) {
print "prowl($HI_PRI, $APP, $HI_EVENT, $text)";
prowl($HI_PRI, $APP, $HI_EVENT, $text);
}
}
####### Private Messages
sub priv {
my ($server, $text, $nick, $host, $channel) = @_;
print "prowl($PRIV_PRI, $APP, $PRIV_EVENT, $text)";
prowl($PRIV_PRI, $APP, $PRIV_EVENT, $text);
}
####### Prowl call
sub prowl {
my ($priority, $application, $event, $description) = @_;
my ($request, $response, $url, $lwp);
print 'pri: '.$priority;
print 'app: '.$application;
print 'event: '.$event;
print 'description: '.$description;
######## Setting up the LWP
$lwp = LWP::UserAgent->new;
$lwp->agent($UA);
# URL Encode
$application =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
$event =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
$description =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
# Setup the url
$url = sprintf("https://prowl.weks.net/publicapi/add?apikey=%s&priority=%d&application=%s&event=%s&description=%s&",
$APIKEY,
$priority,
$application,
$event,
$description
);
print $url;
$request = HTTP::Request->new(GET => $url);
$response = $lwp->request($request);
print $response;
}
####### Bind "message private" to priv()
Irssi::signal_add_last("message private", "priv");
####### Bind "print text" to highlights()
Irssi::signal_add_last("print text", "highlight");
I’ve recently upgraded my iTunes installation on my MacBookPro to 8.1.1 and to my horror found that I’m no longer able to connect to my DAAP library on my NAS.
This is rather strange as the issue has only just appeared in 8.1.1 and does not appear on my windows machines which reside on a different network, and have Bonjour / Rendezvous mDNS traffic broadcast locally by RendevousProxy. After much annoyance, I decided to do a quick check of what an older iTunes library was sending out, and comparing that to Avahi. It turns out that my Avahi configuration was missing some vital Text Records. This wasn’t an issue in previous revisions of the iTunes client, but appears to be an issue in 8.1.1.
I updated my daap.service file in /etc/avahi/services/ to the following
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_daap._tcp</type>
<port>3689</port>
<txt-record>txtvers=1</txt-record>
<txt-record>iTSh Version=131073</txt-record>
<txt-record>Version=196610</txt-record> </service>
</service-group>
And restarted Avahi for good measure and now can connect to my mt-daapd library again!
Categories: Apple, Linux, Software, iTunes, media Tags: Avahi, Bonjour, Bug, iTunes, Linux, Mac, Macintosh, mt-daapd, OSX, Rendezvous