When a GitHub user signs up for an account, GitHub provides a default profile picture that looks something like this:
The user can set a custom profile picture based on instructions here.
The way I can think of is to download the current profile picture from the GitHub user, then download his default profile picture from https://github.com/identicons/USERNAME.png . Then compare these two pictures. But this solution is not beautiful.
Is there a beautiful way to determine whether a GitHub user uses the default profile picture or has set a custom profile picture? Like a boolean value I can check or something like this. Thanks.
GitHub would use the Gravatar service in order to fetch an image associated to a GitHub user email account.
You can query such an image through the Gravatar API. If there is none, that means a default auto-generated image will be used.
When there is no picture associated to an email, GitHub use the ?d=identicon
parameter to generate a geometric pattern based on the email hash:
https://www.gravatar.com/avatar/05b6d7cc7c662bf81e01b39254f88a49?d=identicon
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With