Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created Oct 5, 2018
Embed
What would you like to do?
package main
import (
"fmt"
"syscall/js"
"net/http"
"strconv"
"io/ioutil"
)
func main() {
resp, err := http.Get("https://api.microlink.io/?url=https://twitter.com/futurism/status/882987478541533189&video&palette")
if err != nil {
fmt.Println(err)
}
defer resp.Body.Close()
b, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println(err)
}
js.Global().Get("document").
Call("querySelector", "#html").
Set("value", string(b))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment