Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
|
|
@ -1,2 +1,4 @@
|
|||
import std.stdio;
|
||||
import std.net.curl;
|
||||
auto data = get("https://sourceforge.net");
|
||||
writeln(data);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
fetch("https://sourceforge.net").then(function (response) {
|
||||
return response.text();
|
||||
}).then(function (body) {
|
||||
return body;
|
||||
});
|
||||
const response = await fetch('https://rosettacode.org');
|
||||
const text = await response.text();
|
||||
console.log(text);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,5 @@
|
|||
require("https").get("https://sourceforge.net", function (resp) {
|
||||
let body = "";
|
||||
resp.on("data", function (chunk) {
|
||||
body += chunk;
|
||||
});
|
||||
resp.on("end", function () {
|
||||
console.log(body);
|
||||
});
|
||||
}).on("error", function (err) {
|
||||
console.error("Error: " + err.message);
|
||||
fetch("https://sourceforge.net").then(function (response) {
|
||||
return response.text();
|
||||
}).then(function (body) {
|
||||
return body;
|
||||
});
|
||||
|
|
|
|||
11
Task/HTTPS/JavaScript/https-3.js
Normal file
11
Task/HTTPS/JavaScript/https-3.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
require("https").get("https://sourceforge.net", function (resp) {
|
||||
let body = "";
|
||||
resp.on("data", function (chunk) {
|
||||
body += chunk;
|
||||
});
|
||||
resp.on("end", function () {
|
||||
console.log(body);
|
||||
});
|
||||
}).on("error", function (err) {
|
||||
console.error("Error: " + err.message);
|
||||
});
|
||||
1
Task/HTTPS/PowerShell/https-1.psh
Normal file
1
Task/HTTPS/PowerShell/https-1.psh
Normal file
|
|
@ -0,0 +1 @@
|
|||
Invoke-WebRequest 'https://www.rosettacode.org'
|
||||
|
|
@ -1,11 +1,16 @@
|
|||
var lwp = require('LWP::UserAgent'); # LWP::Protocol::https is needed
|
||||
var url = 'https://rosettacode.org';
|
||||
require('LWP::UserAgent')
|
||||
require('LWP::Protocol::https')
|
||||
|
||||
var ua = lwp.new(
|
||||
agent => 'Mozilla/5.0',
|
||||
ssl_opts => Hash.new(verify_hostname => 1),
|
||||
);
|
||||
func get(url) {
|
||||
static ua = %O<LWP::UserAgent>.new(
|
||||
agent => 'Mozilla/5.0',
|
||||
ssl_opts => Hash(verify_hostname => 1),
|
||||
)
|
||||
var resp = ua.get(url)
|
||||
if (resp.is_success) {
|
||||
return resp.decoded_content
|
||||
}
|
||||
die "Failed to GET #{url}: #{resp.status_line}"
|
||||
}
|
||||
|
||||
var resp = ua.get(url);
|
||||
resp.is_success || die "Failed to GET #{url.dump}: #{resp.status_line}";
|
||||
print resp.decoded_content;
|
||||
say get("https://rosettacode.org")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* https.wren */
|
||||
/* HTTPS.wren */
|
||||
|
||||
var CURLOPT_URL = 10002
|
||||
var CURLOPT_FOLLOWLOCATION = 52
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* gcc https.c -o https -lcurl -lwren -lm */
|
||||
/* gcc HTTPS.c -o HTTPS -lcurl -lwren -lm */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
@ -108,7 +108,7 @@ int main(int argc, char **argv) {
|
|||
config.bindForeignMethodFn = &bindForeignMethod;
|
||||
WrenVM* vm = wrenNewVM(&config);
|
||||
const char* module = "main";
|
||||
const char* fileName = "https.wren";
|
||||
const char* fileName = "HTTPS.wren";
|
||||
char *script = readFile(fileName);
|
||||
WrenInterpretResult result = wrenInterpret(vm, module, script);
|
||||
switch (result) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue