Blogger avatar, or Profile image, is hard or even impossible to get using javascript. In data feeds there is only profile page link, but not the image on that profile page.
To get the image, one should open the profile page, parse the html, find profile image url, and use/load it. This cannot be done in Javascript, because profile page is in different domain (blogger.com). So I did it with Google App Engine. That was quite a trip: completely new programming environment and I did not know much about Python, but I managed to get done what I wanted. Phew!
My profile page: http://www.blogger.com/profile/05137522196636058302
My avatar image: http://avafavico.appspot.com/?userid=05137522196636058302
You can try it on your user id (or any other's) in this post, if you like.
I was going to use the avatar in javascript application as 16x16 picture, so I shrank the Profile pictures to 32x32 to minimize net traffic. Avafavico is just a name... First I thought it could also return favicons to urls that are not blogger profile, but then decided not to reinvent (http://www.google.com/s2/favicons?domain=) the wheel, after that the working name was BlogAva, but that domain was taken.
Here is my Python code. I don't write Python well, so any suggestions how to optimize or make the code better, are welcome! :) Thanks.
A newer version of this Python application is here.
I've used this online application/tool in my newest recent comments gadget, which can be seen on this blog. I'll tell you another day how that is done.
Click on a single comment to hide/show its text
3 comments:
i can't and don't understand about script master :(
i'm just user :P
You good blogger :)
I like your aticle ;)
@Beben Koben Hi, and thanks. Don't worry, as a user you don't have to understand how this works :) It is just a tool that my Recent Comments script uses to get the avatars.
@MS-potilas i want try make like it in google app...xixixixi
but not understand...haiohaahoiahoiah
You there absolutely ;)
See the hack to make the 'Post a Comment' link bigger.
Post a Comment