Created
October 5, 2018 20:33
-
-
Save goofmint/1ae0ae7fcf39aa0b66dacfa7abfd5b39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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