microlink logo

Microlink Recipe for Product Hunt

produchunt.js
const mql = require('@microlink/mql')

const produchunt = (url, opts) =>
  mql(url, {
    data: {
      name: {
        selector: 'h1 a',
        attr: 'text',
        type: 'string',
      },
      upvotes: {
        selector: '.bigButtonCount_10448',
        attr: 'text',
        type: 'string',
      },
    },
    ...opts,
  })

const result = await produchunt(
  'https://www.producthunt.com/posts/microlink-2-0'
)
console.log(result)