From cb157185389f98e3f86a7125c837766c1dafbd81 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 8 Jun 2021 17:44:25 -0400 Subject: [PATCH] Fix Unavatar Twitter Images Currently, it looks like https://unavatar.vercel.app/ used to display the Twitter avatars is not working properly with the @ symbol in the URL. For example: Works: https://unavatar.vercel.app/twitter/tim_leland or https://images.weserv.nl/?url=https://unavatar.now.sh/twitter/wesbos Does not work: https://unavatar.vercel.app/twitter/@tim_leland or https://images.weserv.nl/?url=https://unavatar.now.sh/twitter/@wesbos --- src/components/Person.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Person.js b/src/components/Person.js index 57291761..6270d572 100644 --- a/src/components/Person.js +++ b/src/components/Person.js @@ -24,7 +24,7 @@ function useIntersectionObserver(ref) { export default function Person({ person, currentTag }) { const url = new URL(person.url); - const twitter = `https://unavatar.now.sh/twitter/${person.twitter}`; + const twitter = `https://unavatar.now.sh/twitter/${person.twitter.replace('@', '')}`; const website = `https://unavatar.now.sh/${url.host}`; const unavatar = person.twitter ? `${twitter}?fallback=${website}` : website; const img = `https://images.weserv.nl/?url=${unavatar}&w=100&l=9&af&il&n=-1`;