pyyimt avatar support?

0 views
Skip to first unread message

Jamin W. Collins

unread,
Sep 4, 2008, 9:26:35 AM9/4/08
to py-tra...@googlegroups.com
Looks like the avatar URL for Yahoo has changed from what is in the
transport code. Looking at the current repository source it looks like
the URL was previously changed, but that URL pattern doesn't appear to
work for me.

A little searching turned up what appears to be a functional URL to
replace it with, and a two line change later it looks like it's working.
For those interested, the change is to the avatar.py file, and the
following lines:

#conn = httplib.HTTPConnection("img1.avatar.vip.dcn.yahoo.com")
conn = httplib.HTTPConnection("img.msg.yahoo.com")
if debug: conn.debuglevel=3
try:
#conn.request("GET","/users/%s.medium.png"%aid)
conn.request("GET","/avatar.php?yids=%s"%aid)

Commented lines are the originals.

What would be needed for the transport to publish the existing Jabber
avatar to the Yahoo server?

--
Jamin W. Collins

Norman Rasmussen

unread,
Sep 4, 2008, 9:51:47 AM9/4/08
to py-tra...@googlegroups.com
aid is the avatar id as given in tag 197, which is normally the hash of the image,

It looks like the new php script wants the yahooid, so did you change the code that calls getavatar too?

Cheers

Norman
- Norman Rasmussen
- Email: nor...@rasmussen.co.za
- Home page: http://norman.rasmussen.co.za/

Jamin W. Collins

unread,
Sep 4, 2008, 9:55:05 AM9/4/08
to py-tra...@googlegroups.com
Norman Rasmussen wrote:
> aid is the avatar id as given in tag 197, which is normally the hash of
> the image,

Was just realizing this. Jumped the gun when one contact came back with
an image.

> It looks like the new php script wants the yahooid, so did you change
> the code that calls getavatar too?

I have not yet delved that deeply into it. If it's a quick change for
you, I can hold off otherwise I'll continue. It's not a rush item, I
just came across some free time and figured I'd see if I could get it
working.

--
Jamin W. Collins

Norman Rasmussen

unread,
Sep 4, 2008, 10:03:19 AM9/4/08
to py-tra...@googlegroups.com

cool, well this turns a complicated image fetch operation, into a no-brainer.

Jamin W. Collins

unread,
Sep 4, 2008, 10:10:47 AM9/4/08
to py-tra...@googlegroups.com
Norman Rasmussen wrote:
> On Thu, Sep 4, 2008 at 3:55 PM, Jamin W. Collins
> <jcol...@asgardsrealm.net <mailto:jcol...@asgardsrealm.net>> wrote:
>
> I have not yet delved that deeply into it. If it's a quick change for
> you, I can hold off otherwise I'll continue. It's not a rush item, I
> just came across some free time and figured I'd see if I could get it
> working.
>
>
> cool, well this turns a complicated image fetch operation, into a
> no-brainer.

Yea, just need to wrap my head around the code calling it and decipher
which tag(s) I need to look at. Any reference documentation?

--
Jamin W. Collins

Norman Rasmussen

unread,
Sep 4, 2008, 10:15:30 AM9/4/08
to py-tra...@googlegroups.com
On Thu, Sep 4, 2008 at 4:10 PM, Jamin W. Collins <jcol...@asgardsrealm.net> wrote:
Norman Rasmussen wrote:
> On Thu, Sep 4, 2008 at 3:55 PM, Jamin W. Collins
>     I have not yet delved that deeply into it.  If it's a quick change for
>     you, I can hold off otherwise I'll continue.  It's not a rush item, I
>     just came across some free time and figured I'd see if I could get it
>     working.
> cool, well this turns a complicated image fetch operation, into a
> no-brainer.
Yea, just need to wrap my head around the code calling it and decipher
which tag(s) I need to look at.  Any reference documentation?

At a rough guess, in ylib.py where ymsg_online calls avatar.getavatar, you'd want to pass pay[each][7] instead of pay[each][197].

I think [7] is the user's yid, where-as [197] is the old image hash.

Jamin W. Collins

unread,
Sep 4, 2008, 10:27:42 AM9/4/08
to py-tra...@googlegroups.com
Norman Rasmussen wrote:
>
> At a rough guess, in ylib.py where ymsg_online calls avatar.getavatar,
> you'd want to pass pay[each][7] instead of pay[each][197].
>
> I think [7] is the user's yid, where-as [197] is the old image hash.

Awesome that appears to have done it. I'll work up a patch and send it
over if you'd like.

--
Jamin W. Collins

Norman Rasmussen

unread,
Sep 4, 2008, 10:54:34 AM9/4/08
to py-tra...@googlegroups.com

Yea, that would be great.

Jamin W. Collins

unread,
Sep 4, 2008, 2:00:14 PM9/4/08
to py-tra...@googlegroups.com
Norman Rasmussen wrote:
>
>
> Yea, that would be great.

Here you go.

--
Jamin W. Collins

yahoo-avatar.patch

Norman Rasmussen

unread,
Sep 13, 2008, 5:56:20 PM9/13/08
to py-tra...@googlegroups.com
On Thu, Sep 4, 2008 at 8:00 PM, Jamin W. Collins <jcol...@asgardsrealm.net> wrote:
Norman Rasmussen wrote:
> Yea, that would be great.
Here you go.

Took some time, but it's in CVS now :-)
Reply all
Reply to author
Forward
0 new messages