Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created October 5, 2018 20:33
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 goofmint/1ae0ae7fcf39aa0b66dacfa7abfd5b39 to your computer and use it in GitHub Desktop.
Save goofmint/1ae0ae7fcf39aa0b66dacfa7abfd5b39 to your computer and use it in GitHub Desktop.
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