Sample send IM script?

Parand Darugar darugar at gmail.com
Mon Jul 2 22:43:52 EDT 2007


Alrighty, now I'm having trouble with purple-remote. I'm logged in
with nullclient, confirmed that D-Bus is working via the attached
script which responds to any IMs sent to it. So the environment should
be good to go.

According the purple-remote help message, the format I'm looking for is:
jabber:goim?screenname=testone at localhost&message=hi

So I tried:
purple-remote 'aim:goim?screenname=tdarugar&message=mooo'

and I get:
Traceback (most recent call last):
  File "/usr/local/bin/purple-remote", line 211, in ?
    output = execute(arg)
  File "/usr/local/bin/purple-remote", line 112, in execute
    account = findaccount(accountname, protocol)
  File "/usr/local/bin/purple-remote", line 88, in findaccount
    account = cpurple.PurpleAccountsFindAny(accountname, protocolname)
  File "/usr/local/bin/purple-remote", line 30, in __call__
    raise "Error: " + self.attr + " " + str(args) + " returned " + str(result)
Error: PurpleAccountsFindAny ('', 'prpl-aim') returned 0

Looks like it's looking for a parameter called 'account', so I tried:
purple-remote 'yahoo:goim?account=tdarugar&screenname=tdarugar&message=mooo'
...
  File "/usr/local/bin/purple-remote", line 30, in __call__
    raise "Error: " + self.attr + " " + str(args) + " returned " + str(result)
Error: PurpleAccountsFindAny ('tdarugar', 'prpl-yahoo') returned 0

The environment is:
Linux ubuntu 2.6.17-10-server (VMWare image, 6.10)
Pidgin 2.0.2, compiled from source

What am I doing wrong?

Best,

Parand

On 7/2/07, Parand Darugar <darugar at gmail.com> wrote:
> Dear Etan,
>
> The account is signed in; I can setup an event loop and receive events
> on it. I forgot to mention - on the nullclient side I get:
> ** (process:28764): CRITICAL **: purple_conversation_new: assertion
> `gc != NULL' failed
>
> I'll look at goim command, that seems like a very good lead.
>
> Much thanks,
>
> Parand
>
> On 7/2/07, Etan Reisner <pidgin at unreliablesource.net> wrote:
> > On Mon, Jul 02, 2007 at 04:51:54PM -0700, Parand Darugar wrote:
> > > Hello,
> > <snip>
> > > I start nullclient and I'm able to interact with it using D-Bus.
> > > Here's what I'm trying:
> > >
> > > import dbus, dbus.glib, dbus.decorators, gobject
> > > bus = dbus.SessionBus()
> > > obj = bus.get_object("im.pidgin.purple.PurpleService",
> > > "/im/pidgin/purple/PurpleObject")
> > > purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
> > > name = 'someaccount'
> > > protocol = 'prpl-yahoo'
> > > ac = purple.PurpleAccountsFind(name, protocol)   # returns a non-zero value
> > > conversation = purple.PurpleConversationNew(1, ac, name)  #
> > > conversation returns 0
> > > im = purple.PurpleConversationGetImData(conversation)  # im is also 0
> > > purple.PurpleConvImSend(im, "hello there")
> > >
> > > Do I need some sort of connection or something after I find the
> > > account to make this go?
> > >
> > > Much thanks,
> > >
> > > Parand
> >
> > Have you set up that account in the nullclient? Is it signed on when you
> > try this script?
> >
> > If the account isn't online you are going to need to connect it before you
> > can create a conversation. For reference you can look at what the
> > purple-remote script does for the goim command.
> >
> >         -Etan
> >
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: listen-respond.py
Type: text/x-python
Size: 1948 bytes
Desc: not available
URL: <http://pidgin.im/pipermail/devel/attachments/20070702/2394f2b3/attachment-0002.py>


More information about the Devel mailing list