internetarchive / openlibrary

One webpage for every book ever published!
https://openlibrary.org
GNU Affero General Public License v3.0
5.14k stars 1.35k forks source link

https://archive.org/services/img/@jdlrobson doesn't serve an avatar even though Gravatar associated #1777

Closed jdlrobson closed 4 years ago

jdlrobson commented 5 years ago

Note: I suspect this problem lives outside openlibrary repo. Please point me to the right place to file this issue.

Description

My avatar should show across all pages.

Evidence

When I visit https://archive.org/details/@jdlrobson I see my gravatar (https://web.archive.org/web/https://www.gravatar.com/avatar/45b0863bddc42c3bbb08284d1863ad95)

However... when I visit openlibrary.org the image used is https://archive.org/services/img/@jdlrobson which sadly doesn't seem to show the same avatar as gravatar.

Expectation

https://archive.org/services/img/@jdlrobson should render the content of https://web.archive.org/web/https://www.gravatar.com/avatar/45b0863bddc42c3bbb08284d1863ad95

traceypooh commented 5 years ago

we 'fallback' to gravatar for IA "user pages" if something o/w doesnt exist in "user item" on archive.org

traceypooh commented 5 years ago

naturally i did something more custom than gravatar, eg:
https://archive.org/serve/@tracey_pooh
(FWIW!)

jdlrobson commented 5 years ago

@traceypooh not completely understanding this. I have a gravatar but this is what I see on https://archive.org/details/@jdlrobson now:

screen shot 2019-01-07 at 8 01 59 pm

This is pointing to https://web.archive.org/web/https://www.gravatar.com/avatar/45b0863bddc42c3bbb08284d1863ad95 which is not an img but an html page.

I've never uploaded an profile picture, and would rather avoid doing so, if I can use the gravatar I use on other sites (including openlibrary)!

Pretty sure there's a bug here somewhere... or am I misunderstanding how this all works?

tfmorris commented 5 years ago

It looks like the related image is https://web.archive.org/web/20180910222342if_/https://www.gravatar.com/avatar/45b0863bddc42c3bbb08284d1863ad95. What we probably want is either the Gravatar directly of the equivalent of https://web.archive.org/web/<latest>/https://www.gravatar.com/avatar/45b0863bddc42c3bbb08284d1863ad95, but I'm not sure what the notation for that (or if that is even supported).

traceypooh commented 5 years ago

@jdlrobson so basically brewster wanted us to to not "bug" our users (by loading 3rd party stuff) on the page and @kngenie & co were crawling gravatar and making sure most would be in the WB Machine. so that was kind of the dodge going on there...

jdlrobson commented 5 years ago

Looks fixed to me on the IA side however open library still points to https://archive.org/services/img/@jdlrobson which shows a silhouette

Is that api broken ? Is there another that should be used?

jdlrobson commented 4 years ago

@traceypooh would you mind answering my question on https://github.com/internetarchive/openlibrary/issues/1777#issuecomment-520160271 ? Thanks in advance <3

traceypooh commented 4 years ago

you'd need to upload a photo to the account item. one can do that mousing over the image in the item (in your case, it's falling back to gravatar as mentioned above) when staring at the account item page (only) https://archive.org/details/@jdlrobson

mekarpeles commented 4 years ago

Ok, it seems like http://archive.org/serve/@jdlrobson may fall back to gravatar but https://archive.org/services/img/@jdlrobson doesn't? Open Library is currently using the latter one. If that API needs to work w/ gravatar, going to leave to @bfalling + @traceypooh to support (if they decide) but unless Open Library is supposed to use a different url (to fetch image form archive.org), I'm going to close the issue.

jdlrobson commented 4 years ago

my takeaway from this is that the gravatar is not officially supported which is a shame. I don't plan to upload a photo so if magically one day my gravatar shows up I'll be happy and make sure to thank you :)

tfmorris commented 4 years ago

Since the IA service is unreliable, why don't we just construct the URL ourselves? We can use either of

https://www.gravatar.com/avatar/45b0863bddc42c3bbb08284d1863ad95 https://web.archive.org/web/https://www.gravatar.com/avatar/45b0863bddc42c3bbb08284d1863ad95

The hash is a simple md5 of the email address: https://en.gravatar.com/site/implement/hash/

traceypooh commented 4 years ago

"unreliable" seems a bit far :)
but yes, exactly @tfmorris just do: https://web.archive.org/web/https://www.gravatar.com/avatar/' . md5($eml) or direct gravatar call if you like! :)