|
Avatars: A Proposed Solution
StoreTags: greasemonkey, avatar, avatard, hack
Viewed 3655 times. 11 people liked this blog. You can rate it below if you haven't already.
People who enjoyed reading this: owl, energygiant, mlbot, monty, cbit, frnortnr, utofbu, quicks, Roshi, airliner, adcBicycle
-->
I know a lot of us miss avatars, myself included. They added a lot of enjoyment to the site. So I thought of a workaround.
When I was going to sleep last night, this came to me. Let me preface this by saying that I have never used greasemonkey, whether for running other people's scripts or for writing my own, so perhaps this was written prematurely, but I would like to get the gears turning on this issue again.
Ingredients:
-greasemonkey script.
AND(
(
-a ftp server on which to host the avatars
-some system where users can have a password for uploading or something
)
OR
-a centralized list that points to filenames on other servers (probably slower)
)
Again, I haven't used greasemonkey so I don't know the particulars, but wouldn't it be a matter of (similar to the P___L - banning script):
METHOD 1:
-getting the username from a post
-instead of blocking the post, insert an img src tag based on username
METHOD 2:
-getting the username from a post
-loading the list of references to images, and choosing an image based on username
-insert an img src tag for that image
It seems like this could be done in greasemonkey...right?
I guess I'll look into this on my own.
Some of the advantages of this option are:
-we don't whine to Bogdan for anything
-people who don't care about avatards can just skip on downloading the script
-we don't have to be restricted by the original file size, format limitations (though they are pretty good and we should probably stick to them or something similar)
Disadvantages:
-slower than if avatards were integrated into the site again
-managing the uploading of files would be more tricky
-is going to take up some bandwidth on someone's server
What do you guys think? I think I'd be willing to learn greasemonkey if no one else is interested, and as I'm more confident in my PHP/MySQL skills, I'd probably be willing to offer up some webspace and make a simple interface for uploading.
| |
Comments
06/27/07
+
PM |
QUOTE |
PERMALINK |
REPORT
mlbot
STFU!
06/27/07
+
PM |
QUOTE |
PERMALINK |
REPORT
mlbot
oh, "mlbot" is 5 characters. I thought you meant I wonly made 5-character posts.
06/27/07
+
PM |
QUOTE |
PERMALINK |
REPORT
license
lol.
"if you don't have anything useful to say, don't say it."
06/27/07
+
PM |
QUOTE |
PERMALINK |
REPORT
nagrom
06/27/07
+
PM |
QUOTE |
PERMALINK |
REPORT
mixedtape
didn't read through all the posts but if you can mash a greasemonkey script with the popular gravatars then you wouldn't have to host the avatars. not sure how that could work as gravatars are based upon an email address.
06/27/07
+
PM |
QUOTE |
PERMALINK |
REPORT
license
mixedtape - good call!!
that would work pretty well. I don't think that basing it upon email address would be a problem. I'm setting up a SQL table to work with a PHP script right now and it wouldn't be too hard to modify it to work with this.
my only comment is that 80x80 seems kinda small. how big were the original avatars? wasn't it like 256x192?
06/27/07
+
PM |
QUOTE |
PERMALINK |
REPORT
license
okay, part of the PHP/SQL portion is written now, using gravatar as suggested by mixedtape. there's no changing passwords but for now I can add email addresses manually. I'll make some kind of form later, although I dunno what authentication method should be used.
here's a demo:
link
and here's the details on implementation:
link
so that anyone who wants to pick up the slack -cough- cbit -cough- can, and in the meantime I'll see if I can learn me some javascript/greasemonkey.
06/27/07
+
PM |
QUOTE |
PERMALINK |
REPORT
license
for the rest of ya:
there's little incentive at the moment, but if you want me to add your email address to my little database, then emmail me your address and I'll put it in when I can. I doubt that enough of you will respond that my emmail gets flooded but just in case you can also IM me on google chat (ryanlaws AT NOSPAM gmail.com)
06/27/07
+
PM |
QUOTE |
PERMALINK |
REPORT
license
and then, of course, you're going to want to head on over to gravatar.com and register with the same email address you gave me.
(sorry for all these posts...edit doesn't seem to work on replies to blogs)
06/28/07
+
PM |
QUOTE |
PERMALINK |
REPORT
cbit
Here's how i'd try to do it if the goal was to limit it to one mysql call per em411 page (still wouldnt' put any bets on how fast this would run)..
Set up a php page which is designed to react to a comma delimited string of usernames passed as a POST variable. eg.
cbit,roshi,mlbot
The php page would output straight txt (not html) in response to the post request. It;d do a mysql lookup and the result would be a comma and semicolon delimited string of usernames and image urls, printed stright to the page as text.
cbit;http://www.blah.com/img.jpg,roshi;http://www.arghmyeyes.com/myimg.png
Greasemonkey would first scrape all the usernames on the page into an array, and post them to the php script (you might have to create an invisible form, paste the delimited string into a hidden field in it, and submit the form to get the POST working),
Then GM would grab the text on the resulting page
Then GM would walk through each occurrence of a comment post on the em411page; for each post it would grab the username from the em411 html, then use a regex to compare it with the big string to find the corresponding url for the image; and write the image to the page.
06/28/07
+
PM |
QUOTE |
PERMALINK |
REPORT
cbit
..Of course the same technique applies to using gravatars too--in that case instead of returning username+url combinations, the php script would return username+md5'd email address combinations. (NB. whatever you do _never_ output emails from a script in an unencoded form, spambots will guzzle them up and everyone will be pissed off at you ;) )
06/28/07
+
PM |
QUOTE |
PERMALINK |
REPORT
license
cbit - yep, that's pretty much what it's doing already except that it's not spitting the usernames back.
and the email addresses are of course never publically visible - only the md5 hashes.
06/28/07
+
PM |
QUOTE |
PERMALINK |
REPORT
mixedtape
oooh progress! wish i knew a bit more on the php side so I could help...i'm just a front-end dev ;)
06/28/07
+
PM |
QUOTE |
PERMALINK |
REPORT
pierlu001
avatars are soooo 2005
Recent blogs: first blog!
06/28/07
+
PM |
QUOTE |
PERMALINK |
REPORT
jonbro
haha, I was about to suggest gravatars as well. good to see that people are getting crazy mashy here. I will throw down tonight if I have time.
Register / login
|
^
EM411 is Copyright 2001-2008 EM411.com
All rights reserved. | Contact | RSS
|