Published
Edited
Jun 1, 2021
3 stars
Insert cell
# Microlink

**Microlink Query Language (MQL)** is the official HTTP client for interacting with Microlink API, being the same query parameters been supported:

Want to know how to parse HTML like a browser? Look down and find the function paragraph. Find the way to use MQL.
Insert cell
<embed src="${previewAudio.data.video.url}" width=1000 height=563>
Insert cell
img(user.data.avatar.url)
Insert cell
img(thumb.data.screenshot.url)
Insert cell
thumb = screenshot("https://github.com/abserari")
Insert cell
user = github("abserari")
Insert cell
previewAudio = audioCard("https://www.youtube.com/watch?v=9P6rdqiybaw")
Insert cell
# Function
Insert cell
img = (src) => {
return html`<img src="${src}"></img>`;
}
Insert cell
github = (username) =>
mql(`https://github.com/${username}`, {
data: {
avatar: {
selector: 'a[itemprop="image"] img',
attr: "src",
type: "image"
}
}
})
Insert cell
audioCard = (url, props) =>
mql(url, {
audio: true,
video: true,
iframe: false,
meta: true,
...props
})
Insert cell
screenshot = (url, props) =>
mql(url, {
meta: false,
screenshot: true,
fullPage: false, //"false", "true"
overlay: true ? {} : { browser: "dark" }, //"none", "light", "dark"
prerender: true,
waitFor: 3000,
...props
})
Insert cell
Insert cell
mql = require.alias({ url: window })("@microlink/mql@0.9.5/dist/mql.js")
Insert cell
import { Text, Toggle, Select } from "@observablehq/inputs"
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more