So I want to get the contents of a URL during openStack, but it returns empty.
Now I remember something from years ago that there is an issue with when LC's internet library loads and that you have to do something or other, or wait for some point, or jump through some other hoops before you can call this function... but can't remember it, and couldn't find reference to it via search so I move on. So I'll use the shell function and curl.
'curl http://blahBlahBlah/myfile.txt' in bash shell returns:
123416
123429
But:
get "curl http://blahBlahBlah/myfile.txt"
get shell(it)
returns:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 13 100 13 0 0 28 0 --:--:-- --:--:-- --:--:-- 28
123416
123429
WTF!
URL, shell(curl), Why is LC so frustrating?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: URL, shell(curl), Why is LC so frustrating?
You could try curl silent mode;rrBUSS9EE wrote: 'curl http://blahBlahBlah/myfile.txt' in bash shell returns:
get "curl http://blahBlahBlah/myfile.txt"
get shell(it)
From memory, it should be -s, but check the man pages if it doesn't work.
The difference calling curl from shell and lc is there should be a curl config file
which the shell might read (depends on your OS, version,...) but not lc.
HTH,
Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
Re: URL, shell(curl), Why is LC so frustrating?
Seems that openstack should work, but I guess its possible the library still isn't loaded. Might try using opencard (fires later) and/or using a send in time to do the work. I assume you can get it to work after complete load?
Might also look at the contents of "the result" after the command.
Might also look at the contents of "the result" after the command.
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: URL, shell(curl), Why is LC so frustrating?
Also, since curl acts a bit differently on linux and osx, at least with respect to client certificates, I use wget instead of curl. There are options to return just the data, not any of the statistics. From memory they're
-O- -o /dev/null
Shelling out to curl or wget or httpie should be completely independent of the libURL library, so when it loads shouldn't be a problem.
-O- -o /dev/null
Shelling out to curl or wget or httpie should be completely independent of the libURL library, so when it loads shouldn't be a problem.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev