1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 22:57:46 +00:00

Merge pull request #140 from skelly37/main

This commit is contained in:
Darren Schroeder 2022-02-07 15:44:32 -06:00 committed by GitHub
commit 076ffa87c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,19 @@
#Fetch simple anwser from WolframAlpha API
def wolfram [...query #Your query
] {
let appID = #YOUR APP_ID
let query_string = ($query | str collect " ")
let result = (fetch ("https://api.wolframalpha.com/v1/result?" + ([[appid i]; [$appID $query_string]] | to url)))
$result + ""
}
#Fetch image with full anwser from WolframAlpha API
def wolframimg [...query #Your query
] {
let appID = #YOUR APP_ID
let query_string = ($query | str collect " ")
let filename = ($query_string + ".png")
let link = ("https://api.wolframalpha.com/v1/simple?" + ([[appid i]; [$appID $query_string]] | to url) + "&background=F5F5F5&fontsize=20")
fetch $link | save $filename
echo ("Query result saved in file: " + $filename)
}