Skip to content

Instantly share code, notes, and snippets.

@pagenoare
Created July 1, 2009 14:09
Show Gist options
  • Save pagenoare/138797 to your computer and use it in GitHub Desktop.
Save pagenoare/138797 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import irssi
import feedparser
username = 'pagenoare'
def nowplaying(data, server, witem):
d = feedparser.parse('http://ws.audioscrobbler.com/2.0/user/%s/recenttracks.rss' % username)
title = d.entries[0].title
if not server or not server.connected:
irssi.prnt("Not connected to server")
if isinstance(witem, irssi.Channel) or isinstance(witem, irssi.Query):
witem.command("/me słucha %s" % title.encode('utf-8'))
irssi.command_bind('np', nowplaying)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment