Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: image sourced from github #680

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/add-author.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function fetchUserProfile() {
name: profile.name,
title: "Guest Author",
website: profile.blog,
avatar_url: profile.avatar_url,
avatar_url: `${profile.avatar_url.replace("private-", "").split("?")[0]}?v=4`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
avatar_url: `${profile.avatar_url.replace("private-", "").split("?")[0]}?v=4`,
avatar_url: `${profile.avatar_url.replace("private-", "").split("?")[0]}?v=4`,

We could consider adding a fallback image in case the actual image isn't found, though I'm not sure if GitHub itself provides a fallback image.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good to me, should we use the fallback image which we are using for sponsors? this one
Screenshot 2024-12-21 170645

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am 👍 let's get other's opinions too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fallback also looks good to me.

bio: profile.bio,
twitter_username: profile.twitter_username,
github_username: profile.login,
Expand Down
4 changes: 2 additions & 2 deletions tools/fetch-sponsors.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ async function fetchGitHubSponsors() {
// return an array in the same format as Open Collective
.map(({ sponsor, tier }) => ({
name: sponsor.name || sponsor.login,
image: sponsor.avatarUrl,
image: `${sponsor.avatarUrl.replace("private-", "").split("?")[0]}?v=4`,
url: fixUrl(sponsor.websiteUrl || sponsor.url),
monthlyDonation: tier.monthlyPriceInDollars,
source: "github",
Expand All @@ -365,7 +365,7 @@ async function fetchGitHubSponsors() {
.map(({ sponsor, timestamp, tier, id }) => ({
id,
name: sponsor.name || sponsor.login,
image: sponsor.avatarUrl,
image: `${sponsor.avatarUrl.replace("private-", "").split("?")[0]}?v=4`,
url: fixUrl(sponsor.websiteUrl || sponsor.url),
amount: tier.monthlyPriceInDollars,
date: timestamp,
Expand Down
2 changes: 1 addition & 1 deletion tools/fetch-team-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async function fetchUserProfile(username) {
: profile.blog
? `https://${profile.blog}`
: profile.blog,
avatar_url: profile.avatar_url,
avatar_url: `${profile.avatar_url.replace("private-", "").split("?")[0]}?v=4`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we extract this into a shared place (e.g., tools/utils.js) as a function so that we don't have to repeat the same logic in multiple files?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some URLs have u parameter:

"name": "Workleap",
"image": "https://avatars.githubusercontent.com/u/53535748?u=d1e55d7661d724bf2281c1bfd33cb8f99fe2465f&v=4",

Any ideas about what it represents?

Should we maybe remove just the jwt parameter and leave the others?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some URLs have u parameter:

Can it stands for unique? even though without this parameter the results are same.

Also seems links are already fixed by commit e385d5f should we still apply this fix?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also seems links are already fixed by commit e385d5f should we still apply this fix?

I also noticed that it might be a good idea to wait a couple of days. If GitHub is still testing features with a subset of users, it could potentially break again. As of now, we might not be part of the experiment, but if they do a full rollout, we could be impacted.

bio: profile.bio,
twitter_username: profile.twitter_username,
github_username: profile.login,
Expand Down
Loading