-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
33 lines (27 loc) · 824 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const LinksSocialMedia = {
github: 'ramondev8',
youtube: 'channel/UCSfwM5u0Kce6Cce8_S72olg',
instagram: 'ramondev8',
linkedin: 'in/ramon-cruz-08298b59',
twitter: 'ramondev8'
}
function changeSocialMediaLinks() {
for (let li of socialLinks.children) {
const social = li.getAttribute('class')
li.children[0].href = `http://${social}.com/${LinksSocialMedia[social]}`
}
}
changeSocialMediaLinks()
function getGitHubProfileInfos() {
const url = `https://api.github.com/users/${LinksSocialMedia.github}`
fetch(url)
.then(response => response.json())
.then(data => {
userName.textContent = data.name
userBio.textContent = data.bio
userLink.href = data.html_url
userPhoto.src = data.avatar_url
userLogin.textContent = data.login
})
}
getGitHubProfileInfos()