Microlink × GitHub
Interact withgithub.com
github.js
import createClient from 'microlink.io'
const microlink = createClient()
const github = (url, opts) =>
microlink.metadata(url, {
data: {
stats: {
selector: '.application-main',
attr: {
followers: {
selector: '.js-profile-editable-area a[href*="tab=followers"] span',
type: 'number'
},
following: {
selector: '.js-profile-editable-area a[href*="tab=following"] span',
type: 'number'
},
stars: {
selector: '.js-responsive-underlinenav a[data-tab-item="stars"] span',
type: 'number'
}
}
}
},
...opts
})
const result = await github('https://github.com/kikobeats')
console.log(result)