#get text from url

1 messages · Page 1 of 1 (latest)

karmic heart
#
function FetchVersion() :: string:
    set {_link} to "https://raw.githubusercontent.com/DjDisaster/SkriptUtils/main/Utils.sk"
    set {_inStream} to new URL({_link})
    set {_inStream} to {_inStream}.openStream()
    set {_result} to IOUtils.toString({_inStream}, StandardCharsets.UTF_8)
    set {_result} to first element out of ({_result} split at nl)
    set {_result} to 2nd element out of ({_result} split at "Version: ")
        
    return {_result}```
You can use IOUtils to get a string from a stream
#

org.apache.commons.io.IOUtils

#

text from a url is vanilla?

#

I don't believe theres any valid syntax in vanilla skript like that

rich wraith
#

its from skquery

#

if you want to perform web requests use reqn or skjson, skquery should not be used