Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
4
Task/HTTPS/EchoLisp/https.echolisp
Normal file
4
Task/HTTPS/EchoLisp/https.echolisp
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
;; asynchronous call back definition
|
||||
(define (success name text) (writeln 'Loaded name) (writeln text))
|
||||
;;
|
||||
(file->string success "https:/sourceforge.net")
|
||||
3
Task/HTTPS/Lasso/https.lasso
Normal file
3
Task/HTTPS/Lasso/https.lasso
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
local(x = curl('https://sourceforge.net'))
|
||||
local(y = #x->result)
|
||||
#y->asString
|
||||
10
Task/HTTPS/Lingo/https-1.lingo
Normal file
10
Task/HTTPS/Lingo/https-1.lingo
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
ch = xtra("Curl").new()
|
||||
CURLOPT_URL = 10002
|
||||
ch.setOption(CURLOPT_URL, "https://sourceforge.net")
|
||||
res = ch.exec(1)
|
||||
if integerP(res) then
|
||||
put "Error:" && curl_error(res)
|
||||
else
|
||||
put "Result:" && res.readRawString(res.length)
|
||||
end if
|
||||
-- "Result: <!doctype html> ..."
|
||||
2
Task/HTTPS/Lingo/https-2.lingo
Normal file
2
Task/HTTPS/Lingo/https-2.lingo
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
sx = xtra("Shell").new()
|
||||
put sx.shell_cmd("curl https://sourceforge.net")
|
||||
2
Task/HTTPS/LiveCode/https-1.livecode
Normal file
2
Task/HTTPS/LiveCode/https-1.livecode
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
libURLSetSSLVerification true --check cert
|
||||
get URL "https://sourceforge.net/"
|
||||
10
Task/HTTPS/LiveCode/https-2.livecode
Normal file
10
Task/HTTPS/LiveCode/https-2.livecode
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
on myUrlDownloadFinished
|
||||
get URL "https://sourceforge.net/" -- this will now fetch a locally cached copy
|
||||
put it
|
||||
end myUrlDownloadFinished
|
||||
|
||||
command getWebResource
|
||||
libURLFollowHttpRedirects true
|
||||
libURLSetSSLVerification true --check cert
|
||||
load URL "https://sourceforge.net/" with message "myUrlDownloadFinished"
|
||||
end getWebResource
|
||||
3
Task/HTTPS/Nim/https.nim
Normal file
3
Task/HTTPS/Nim/https.nim
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import httpclient
|
||||
|
||||
echo getContent "https://sourceforge.net"
|
||||
2
Task/HTTPS/Ring/https.ring
Normal file
2
Task/HTTPS/Ring/https.ring
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
cStr= download("http://sourceforge.net/")
|
||||
see cStr + nl
|
||||
11
Task/HTTPS/Sidef/https.sidef
Normal file
11
Task/HTTPS/Sidef/https.sidef
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
var lwp = require('LWP::UserAgent'); # LWP::Protocol::https is needed
|
||||
var url = 'https://rosettacode.org';
|
||||
|
||||
var ua = lwp.new(
|
||||
agent => 'Mozilla/5.0',
|
||||
ssl_opts => Hash.new(verify_hostname => 1),
|
||||
);
|
||||
|
||||
var resp = ua.get(url);
|
||||
resp.is_success || die "Failed to GET #{url.dump}: #{resp.status_line}";
|
||||
print resp.decoded_content;
|
||||
15
Task/HTTPS/Swift/https.swift
Normal file
15
Task/HTTPS/Swift/https.swift
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import Foundation
|
||||
|
||||
// With https
|
||||
let request = NSURLRequest(URL: NSURL(string: "https://sourceforge.net")!)
|
||||
|
||||
NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue()) {res, data, err in // callback
|
||||
|
||||
// data is binary
|
||||
if (data != nil) {
|
||||
let string = NSString(data: data!, encoding: NSUTF8StringEncoding)
|
||||
println(string)
|
||||
}
|
||||
}
|
||||
|
||||
CFRunLoopRun() // dispatch
|
||||
Loading…
Add table
Add a link
Reference in a new issue