document.body.style.backgroundImage = `url
(https://images.unsplash.com/photo-1560008511-11c63416e52d?crop=entropy&cs=tinysrgb&fit=max&
fm=jpg&ixid=MnwyMTEwMjl8MHwxfHJhbmRvbXx8fHx8fHx8fDE2MjI4NDIxMTc&ixlib=rb-1.2.1&q=80&w=1080
)`
document.getElementById("author").textContent = `By: Dodi Achmad`
})
/**
* Challenge: Pull down the cryptocurrency data for dogecoin from the
* CoinGecko API and log it to the console
*
* Also add a .catch() method to console any errors that might occur to the console
*/
fetch("https://apis.scrimba.com/unsplash/photos/random?orientation=landscape&query=nature")
.then(res => res.json())
.then(data => {
document.body.style.backgroundImage = `url(${data.urls.regular})`
document.getElementById("author").textContent = `By: ${data.user.name}`
})
.catch(err => {
// Use a default background image/author