Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Kikobeats
Created May 10, 2018 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kikobeats/a700ad878db7282bdda58fb6c082df9c to your computer and use it in GitHub Desktop.
Save Kikobeats/a700ad878db7282bdda58fb6c082df9c to your computer and use it in GitHub Desktop.
Microlink API custom rules integration
'use strict'
const microlinkAPI = require('microlink-api')('YOUR_API_KEY')
;(async() => {
const url = 'https://google.com'
const opts = {
prerender: false,
// You can extend the current rules or add more!
rules: {
type: [
({ htmlDom: $, meta, url: baseUrl }) => {
const value = $('meta[property="og:site_name"]') || 'web'
return value
}
]
}
}
const {status, data} = await microlinkAPI(url, opts)
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment