September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,18 @@
'
' Read and display a website
'
SPLIT ARGUMENT$ BY " " TO arg$ SIZE dim
IF dim < 2 THEN
website$ = "www.basic-converter.org"
ELSE
website$ = arg$[1]
ENDIF
OPEN CONCAT$(website$, ":80") FOR NETWORK AS mynet
SEND CONCAT$("GET / HTTP/1.1\r\nHost: ", website$, "\r\n\r\n") TO mynet
REPEAT
RECEIVE dat$ FROM mynet
total$ = total$ & dat$
UNTIL ISFALSE(WAIT(mynet, 5000))
CLOSE NETWORK mynet
PRINT total$

View file

@ -0,0 +1 @@
curl -s -L http://rosettacode.org/

View file

@ -0,0 +1 @@
lynx -source http://rosettacode.org/

View file

@ -0,0 +1 @@
wget -O - -q http://rosettacode.org/

View file

@ -0,0 +1 @@
lftp -c "cat http://rosettacode.org/"

View file

@ -0,0 +1 @@
ftp -o - http://rosettacode.org ^ /dev/null

View file

@ -0,0 +1,5 @@
#listix#
<main>
LOOP, TEXT FILE, http://www.rosettacode.org
, BODY, @<value>

View file

@ -0,0 +1 @@
echo http("http://www.rosettacode.org");

View file

@ -0,0 +1,13 @@
// version 1.1.2
import java.net.URL
import java.io.InputStreamReader
import java.util.Scanner
fun main(args: Array<String>) {
val url = URL("http://www.puzzlers.org/pub/wordlists/unixdict.txt")
val isr = InputStreamReader(url.openStream())
val sc = Scanner(isr)
while (sc.hasNextLine()) println(sc.nextLine())
sc.close()
}

View file

@ -0,0 +1 @@
(get-url "http://www.rosettacode.org")

View file

@ -0,0 +1,6 @@
url=.bsf~new("java.net.URL","http://teletext.orf.at")
sc =.bsf~new("java.util.Scanner",url~openStream)
loop while sc~hasNext
say sc~nextLine
End
::requires BSF.CLS -- get Java camouflaging support

View file

@ -1 +0,0 @@
<@ SAYURLLIT>http://rosettacode.org/wiki/Main_Page</@>

View file

@ -1 +0,0 @@
<# SAY URLSOURCE LITERAL>http://rosettacode.org/wiki/Main_Page</#>

View file

@ -1,13 +1,13 @@
func get(url) {
var lwp = (
try { require('LWP::UserAgent') }
catch { warn "'LWP::UserAgent' is not installed!"; return }
);
var ua = lwp.new(agent => 'Mozilla/5.0');
catch { warn "'LWP::UserAgent' is not installed!"; return nil }
)
var ua = lwp.new(agent => 'Mozilla/5.0')
if (var resp = ua.get(url); resp.is_success) {
return resp.decoded_content;
};
return;
return resp.decoded_content
}
return nil
}
print get("http://rosettacode.org");
print get("http://rosettacode.org")

14
Task/HTTP/Zkl/http.zkl Normal file
View file

@ -0,0 +1,14 @@
url := ask(0,"URL: ");
host := url;
dir := "/";
port := 80;
if (n := url.find("/")) { dir = url[n,*]; host = url[0,n]; }
if (n := host.find(":")) { port = host[n+1,*]; host = host[0,n]; }
get := "GET %s HTTP/1.0\r\nHost: %s:%s\r\n\r\n".fmt(dir,host,port.toInt());
println("-->",get);
server := Network.TCPClientSocket.connectTo(host,port);
server.write(get);
data := server.read(True);
println(data.text);