|
Avatars: A Proposed Solution
StoreTags: greasemonkey, avatar, avatard, hack
Viewed 3588 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/28/07
+
PM |
QUOTE |
PERMALINK |
REPORT
jonbro
also, I should mention that the caching is gonna be the hardest part.
Also, I think gm has some type of built in thing for doing ajax requests, however, I am not sure you are allowed to ajax post to just any random server on the internet. Something that should be looked into certainly.
06/28/07
+
PM |
QUOTE |
PERMALINK |
REPORT
cbit
This script replaces email addresses with pics if they are gravatar registered link might be useful for cutting+pasting parts.
06/29/07
+
PM |
QUOTE |
PERMALINK |
REPORT
license
okay,
I think people are going to be understandably paranoid about email addresses. so I think I'm just going to store the md5 hashes.
what I'm trying to think of is a way that the email addresses could automatically be entered into the DB. there's a couple ways I can think of to do this. one is that you emmail me the md5 hash of your email address (and for those who don't have a way of figuring that out, I could write a super-simple little PHP script to do that), and then I could manually enter them. another way is to have a thread where we just post the hash, and nothing else, and then I could write a script to go through that and put that into my DB. I don't know how to parse external HTML in PHP yet but it doesn't seem difficult.
do we need caching if we're using gravatars? I don't believe so...
I'll probably have to put this down for a little little while. I'm kind of on vacation for 2 days anyway. so I'll pick this back up when I'm able. I really don't like abandoning projects anymore, so I'm going to finish this one way or another, I just wanted to let you guys know so that anyone who wants to get involved, can.
edited: Jun 30 2007
+
PM |
QUOTE |
PERMALINK |
REPORT
cbit
Whoever set up the system, if it was one that depended on manual entry of username+emails, would be the one who would have to constantly maintain it too (if new users want gravatars etc) 
One simple way to get some initial values in the db (but completely usecure and open to abuse), is that you write a simple form connected to a script. the form asks for em411 username and gravatar email, people visit that from and fill it in. The script then stores the usernames and md5'd versions of the passwords in the db.
06/30/07
+
PM |
QUOTE |
PERMALINK |
REPORT
jonbro
one way to do it that would be less open to abuse would be insert the form in an em411 page, just ask for the email, and use grease monkey to grab the username. potentially even post to the em411 login form with greasemonkey and check to make sure that the login goes through. Probably overkill. As for caching, I meant in terms not of getting the gravatars, but lowering the strain on the server of whoever is hosting the em411 username -> gravatar hash server.
06/30/07
+
PM |
QUOTE |
PERMALINK |
REPORT
license
cbit: the 'open to abuse' part is why I would rather someone manually enter the data. there's no stopping a troll from going to the form and putting in an x-rated gravatar with some pr0n on it.
possible solutions:
-an email address/hash can only be entered once per username.
-the script scans for whether a hash is already in the database before adding it
maybe both?
this also requires maintenance, but certainly less than it would be if I had to manually enter all the names.
IDEAL solution (IMO), given the present scenario:
do something like what jonbro was talking about, but rather than writing a hack in greasemonkey, just to start a simple, normal thread where users can simply post the hash of their gravatar. this means that their email addresses are never visible. then a script could parse the HTML and just grab the hashes, and throw away any post that doesn't fit the form of a hash (what is it, 40 characters of hex?). I'll have to learn to parse HTML on an external server, but once I figure that out then it'll basically write itself.
edited: Jun 30 2007
+
PM |
QUOTE |
PERMALINK |
REPORT
cbit
"possible solutions:
-an email address/hash can only be entered once per username.
-the script scans for whether a hash is already in the database before adding it"
This sounds like a sensible middle way. if it were me id offer a form (email and em411 username) validate against the existing records, and manually edit individual records if/when necessary (starting a thread asking users to post md5s emails sounds like more work all round, to me.. but might be a useful GM exercise )
Register / login
|
^
EM411 is Copyright 2001-2008 EM411.com
All rights reserved. | Contact | RSS
|