This thread will be about using ScriptBasic and the
cURL extension module. The first example is what I call my
Hello Me cURL example. This is also included in the extension module test scripts I posted in the
Resources thread.
' MyIP
IMPORT curl.bas
ch = curl::init()
curl::option(ch,"URL","ipinfo.io")
PRINT curl::perform(ch),"\n"
curl::finish(ch)
Output
pi@RPi3B:~/sbrpi/examples $ time scriba myip.sb
{
"ip": "#4.#9.#1.#11",
"hostname": "c-#4-#9-#1-#11.hsd1.wa.comcast.net",
"city": "Anacortes",
"region": "Washington",
"country": "US",
"loc": "48.5004,-122.6310",
"postal": "98221",
"org": "AS33650 Comcast Cable Communications, LLC"
}
real 0m0.334s
user 0m0.049s
sys 0m0.016s
pi@RPi3B:~/sbrpi/examples $