1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-02 15:17:47 +00:00

Update wolframalpha.nu

documented commands
This commit is contained in:
Kamil 2022-02-07 21:37:17 +00:00 committed by GitHub
parent 806956529a
commit aae15eecb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,11 +1,15 @@
def wolfram [...query] { #Fetch simple anwser from WolframAlpha API
def wolfram [...query #Your query
] {
let appID = #YOUR APP_ID let appID = #YOUR APP_ID
let query_string = ($query | str collect " ") let query_string = ($query | str collect " ")
let result = (fetch ("https://api.wolframalpha.com/v1/result?" + ([[appid i]; [$appID $query_string]] | to url))) let result = (fetch ("https://api.wolframalpha.com/v1/result?" + ([[appid i]; [$appID $query_string]] | to url)))
$result + "" $result + ""
} }
def wolframimg [...query] { #Fetch image with full anwser from WolframAlpha API
def wolframimg [...query #Your query
] {
let appID = #YOUR APP_ID let appID = #YOUR APP_ID
let query_string = ($query | str collect " ") let query_string = ($query | str collect " ")
let filename = ($query_string + ".png") let filename = ($query_string + ".png")