Skip to content

Commit

Permalink
fix: setup clearbit fallback properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jun 9, 2019
1 parent 27d1942 commit da0464d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/providers/clearbit.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ module.exports = async url => {
size: AVATAR_SIZE
})}`

try {
await got.head(logoUrl)
return logoUrl
} catch (err) {
return null
}
await got.head(logoUrl)
return logoUrl
}

module.exports.supported = {
Expand Down
4 changes: 2 additions & 2 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ <h3>Twitter</h3>
<h3>YouTube</h3>
<p><code>&lt;img src="https://unavatar.now.sh/youtube/:username" /&gt;</code></p>
<p>i.e <a target="_blank" href="https://unavatar.now.sh/youtube/caseyneistat">https://unavatar.now.sh/youtube/caseyneistat</a></p>
<h3>Other domain</h3>
<h3>Clearbit</h3>
<p><code>&lt;img src="https://unavatar.now.sh/domain/:domain" /&gt;</code></p>
<p>i.e <a target="_blank" href="https://unavatar.now.sh/domain/reddit.com">https://unavatar.now.sh/domain/reddit.com</a></p>
<p>i.e <a target="_blank" href="https://unavatar.now.sh/clearbit/reddit.com">https://unavatar.now.sh/clearbit/reddit.com</a></p>
</article>
<script src="js/main.min.js"></script>
</body>
Expand Down

0 comments on commit da0464d

Please sign in to comment.