Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

20
Task/HTTP/AWK/http.awk Normal file
View file

@ -0,0 +1,20 @@
BEGIN {
site="en.wikipedia.org"
path="/wiki/"
name="Rosetta_Code"
server = "/inet/tcp/0/" site "/80"
print "GET " path name " HTTP/1.0" |& server
print "Host: " site |& server
print "\r\n\r\n" |& server
while ( (server |& getline fish) > 0 ) {
if ( ++scale == 1 )
ship = fish
else
ship = ship "\n" fish
}
close(server)
print ship
}

View file

@ -0,0 +1,6 @@
(with-current-buffer
(url-retrieve-synchronously "http://www.rosettacode.org")
(goto-char (point-min))
(search-forward "\n\n" nil t) ;; skip headers
(prin1 (buffer-substring (point) (point-max)))
(kill-buffer (current-buffer)))

View file

@ -1 +1,2 @@
require'web/gethttp'
gethttp 'http://www.rosettacode.org'

View file

@ -1,5 +1,5 @@
/* NetRexx */
options replace format comments java crossref savelog symbols binary
options replace format comments java crossref symbols binary
import java.util.Scanner
import java.net.URL

View file

@ -2,6 +2,6 @@ use v6;
my $socket = IO::Socket::INET.new(host => "www.rosettacode.org",
port => 80,);
$socket.send("GET / HTTP/1.0\r\n\r\n");
$socket.print("GET / HTTP/1.0\r\n\r\n");
print $socket.recv();
$socket.close;

View file

@ -0,0 +1,2 @@
[dependencdies]
hyper = "0.6"

View file

@ -0,0 +1,12 @@
extern crate hyper;
use std::io::Read;
use hyper::client::Client;
fn main() {
let client = Client::new();
let mut resp = client.get("http://rosettacode.org").send().unwrap();
let mut body = String::new();
resp.read_to_string(&mut body).unwrap();
println!("{}", body);
}

View file

@ -0,0 +1,4 @@
(use http-client)
(print
(with-input-from-request "http://google.com/"
#f read-string))