Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
30
Task/HTTP/Lingo/http-1.lingo
Normal file
30
Task/HTTP/Lingo/http-1.lingo
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
property _netID
|
||||
property _cbHandler
|
||||
property _cbTarget
|
||||
|
||||
----------------------------------------
|
||||
-- Simple HTTP GET request
|
||||
-- @param {string} url
|
||||
-- @param {symbol} cbHandler
|
||||
-- @param {object} [cbTarget=_movie]
|
||||
----------------------------------------
|
||||
on new (me, url, cbHandler, cbTarget)
|
||||
if voidP(cbTarget) then cbTarget = _movie
|
||||
me._netID = getNetText(url)
|
||||
me._cbHandler = cbHandler
|
||||
me._cbTarget = cbTarget
|
||||
_movie.actorList.add(me)
|
||||
return me
|
||||
end
|
||||
|
||||
----------------------------------------
|
||||
-- @callback
|
||||
----------------------------------------
|
||||
on stepFrame (me)
|
||||
if netDone(me._netID) then
|
||||
res = netTextResult(me._netID)
|
||||
err = netError(me._netID)
|
||||
_movie.actorList.deleteOne(me)
|
||||
call(me._cbHandler, me._cbTarget, res, err)
|
||||
end if
|
||||
end
|
||||
17
Task/HTTP/Lingo/http-2.lingo
Normal file
17
Task/HTTP/Lingo/http-2.lingo
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
----------------------------------------
|
||||
--
|
||||
----------------------------------------
|
||||
on getAdobeHomePage ()
|
||||
script("SimpleHttpGet").new("http://www.adobe.com/", #printResult)
|
||||
end
|
||||
|
||||
----------------------------------------
|
||||
-- @callback
|
||||
----------------------------------------
|
||||
on printResult (res, err)
|
||||
if err="OK" then
|
||||
put res
|
||||
else
|
||||
put "Network Error:" && err
|
||||
end if
|
||||
end
|
||||
3
Task/HTTP/Lingo/http-3.lingo
Normal file
3
Task/HTTP/Lingo/http-3.lingo
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
getAdobeHomePage()
|
||||
-- "<!doctype html>
|
||||
...
|
||||
Loading…
Add table
Add a link
Reference in a new issue