rola_songbird.py

May 1, 2009

Based on the script published by gnuget rola-banshee.py this is a little hack to work with songbird 1.1.1 using the dbus add-on, with 1.1.2 don’t work because the add-on didn’t work with the new version

#! /usr/bin/env python
# -*- coding: utf-8 -*-

#Author: Isaac I. Torres
#Correo: istodi[arroba]gmail[punto]com
#Based on rola-banshee.py http://gnuget.underlife.org/blog/view/203/rola-banshee-py

version = "1.0"

__module_name__ = "rola_songbird.py"
__module_version__ = version

import dbus
import xchat

class RolaSongbird:

  def __init__(self):
    self.songbird = dbus.SessionBus()
    self.songbird = self.songbird.get_object("org.mozilla.songbird","/org/mozilla/songbird")
    xchat.prnt("rola-songbird.py Version %s loaded!" % (version))
    xchat.prnt("/rola")

  def rola(self, word, word_eol, userdata):
    song = self.songbird.getTitle()
    artist = self.songbird.getArtist()
    xchat.command("me esta escuchando: %s - %s" % (artist, song))
    return xchat.EAT_XCHAT

control = RolaSongbird()
xchat.hook_command("rola", control.rola)

Entry Filed under: Blog. Tags: , , , , .


Blogroll

Tags

bash dbus Debian glp Gnome GNU/Linux Humor Opinion Personal Programacion python Rails reunion Ruby scaffolding shell scripting Software Libre songbird Variado Web Web 2.0 WTF! xchat