Created
July 1, 2009 14:09
-
-
Save pagenoare/138797 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/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