laravel.io icon indicating copy to clipboard operation
laravel.io copied to clipboard

Replace default GitHub avatar

Open driesvints opened this issue 3 years ago • 12 comments

Figure our a way to show a grayed out Laravel logo as a default avatar instead of the current default GitHub one.

driesvints avatar Sep 29 '21 10:09 driesvints

Gonna re-open this to keep our target to also figure out a way to replace the default GitHub avatar. Maybe we can sync through GitHub web hooks to figure out if a user is using a default GitHub avatar or not.

driesvints avatar Jan 08 '22 15:01 driesvints

To be clear: I mean the coloured block ones in this screenshot should also be the greyed out Laravel.io icon.

Screenshot 2022-01-08 at 16 22 24

driesvints avatar Jan 08 '22 15:01 driesvints

Additionally, we should filter out empty avatars on the homepage so we have a full wall of photo's.

driesvints avatar Jan 17 '22 13:01 driesvints

Might also want to remove unavatar in total because we seem to be running into rate limiting issues. Not sure what the best way forward is here.

driesvints avatar Nov 06 '23 13:11 driesvints

  • get user info from api https://api.github.com/users/USERNAME
  • on 200, temporarily download image $response->avatar_url
  • if image !png, return
  • if image !420x420, return
  • if image has > 2 colours, return (more resource intensive)

Not sure if I'll have enough time to sit and implement this, but thought I'd leave these notes regardless

for reference

ProjektGopher avatar Nov 06 '23 18:11 ProjektGopher

oh nice @ProjektGopher. Thanks a lot for digging into that! Definitely useful for follow up.

driesvints avatar Nov 06 '23 20:11 driesvints

Might also want to remove unavatar

We could store a user’s GitHub avatar URL in the DB when they register. Then we could check if the URL needs to be updated each time a user logs in or through a scheduled job.

imacrayon avatar Nov 12 '23 13:11 imacrayon

@imacrayon yeah I was first thinking about GitHub webhooks but that might be a bit too complex. A middleware on logged in routes that checks the updated_at timestamp of a logged in user and rechecks the avatar might work.

driesvints avatar Nov 14 '23 15:11 driesvints