Skip to content

Commit

Permalink
Add instagram support
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Apr 18, 2018
1 parent 8ea2e4f commit e0780c0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/services/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
const { reduce } = require('lodash')

const services = {
twitter: require('./twitter'),
github: require('./github'),
gravatar: require('./gravatar'),
github: require('./github')
instagram: require('./instagram'),
twitter: require('./twitter')
}

const servicesBy = reduce(
Expand Down
15 changes: 15 additions & 0 deletions src/services/instagram.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict'

const cheerio = require('cheerio')
const got = require('got')

module.exports = async username => {
const { body } = await got(`https://www.instagram.com/${username}`)
const $ = cheerio.load(body)
return $('meta[property="og:image"]').attr('content')
}

module.exports.supported = {
email: false,
username: true
}

0 comments on commit e0780c0

Please sign in to comment.