« | Main | »

February 12, 2011

I was looking for way to connect pandora.com and rd.io -- in particular, an easy way explore rd.io for artists I listen to and like in pandora. Manually searching in rd.io for an artist I hear in pandora is too cumbersome. There doesn't seem to be a nice way, but the following will print a list of the search links for every artist you listen to in pandora:
tshark -i "en1" -x -f "ip src pandora.com"  | \
 awk -F"   " '/^$/ {print} /^[0-9a-f]{4}/ {printf("%s",$2)}' |\
 perl -n -e 'm/<artistExplorer[^>]+name="([^"]+)"/ && ($n=$1) ||\
 ($n=~s/\s+/%20/g) && \
 print "http://www.rdio.com/#/search/$n/artists/\n"'
So, when you are listening to an artist in pandora for whom you'd like to search in rd.io, just click the more recent link in the terminal.

pandoradio.png

A few notes:
  • tshark should point to the tshark binary of Wireshark. If it's not pointed there, this won't work. If you don't have Wireshark installed, also, this won't work
  • I'm using en1 as my interface, you may want to change this


Posted by jeff at February 12, 2011 03:00 PM