-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bacon_Space
authored
Oct 7, 2023
1 parent
a5c3178
commit 175e87f
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Fetch the StreamStats user's avatar from GitHub API | ||
fetch('https://api.github.com/users/StreamStats') | ||
.then(response => response.json()) | ||
.then(data => { | ||
// Extract the avatar URL from the API response | ||
const avatarUrl = data.avatar_url; | ||
const twitterImage = document.getElementById('twitter-image'); | ||
twitterImage.content = avatarUrl; | ||
// Update the href attribute of the favicon link | ||
const favicon = document.getElementById('favicon'); | ||
favicon.href = avatarUrl; | ||
}) | ||
.catch(error => { | ||
console.error('Error fetching avatar:', error); | ||
}); |