microlink logo

Microlink Recipe

Interact with reddit.com

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

const reddit = (url, opts) =>
  mql(url, {
    data: {
      karma: {
        selector: '#profile--id-card--highlight-tooltip--karma',
      },
      birthday: {
        selector: '#profile--id-card--highlight-tooltip--cakeday',
      },
      avatar: {
        selector: 'img[alt="User avatar"]',
        attr: 'src',
        type: 'url',
      },
    },
    ...opts,
  })

const result = await reddit('https://www.reddit.com/user/kikobeats')

mql.render(result)