September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
18
Task/HTTP/BaCon/http.bacon
Normal file
18
Task/HTTP/BaCon/http.bacon
Normal 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$
|
||||
1
Task/HTTP/Friendly-interactive-shell/http-1.fish
Normal file
1
Task/HTTP/Friendly-interactive-shell/http-1.fish
Normal file
|
|
@ -0,0 +1 @@
|
|||
curl -s -L http://rosettacode.org/
|
||||
1
Task/HTTP/Friendly-interactive-shell/http-2.fish
Normal file
1
Task/HTTP/Friendly-interactive-shell/http-2.fish
Normal file
|
|
@ -0,0 +1 @@
|
|||
lynx -source http://rosettacode.org/
|
||||
1
Task/HTTP/Friendly-interactive-shell/http-3.fish
Normal file
1
Task/HTTP/Friendly-interactive-shell/http-3.fish
Normal file
|
|
@ -0,0 +1 @@
|
|||
wget -O - -q http://rosettacode.org/
|
||||
1
Task/HTTP/Friendly-interactive-shell/http-4.fish
Normal file
1
Task/HTTP/Friendly-interactive-shell/http-4.fish
Normal file
|
|
@ -0,0 +1 @@
|
|||
lftp -c "cat http://rosettacode.org/"
|
||||
1
Task/HTTP/Friendly-interactive-shell/http-5.fish
Normal file
1
Task/HTTP/Friendly-interactive-shell/http-5.fish
Normal file
|
|
@ -0,0 +1 @@
|
|||
ftp -o - http://rosettacode.org ^ /dev/null
|
||||
5
Task/HTTP/Gastona/http.gastona
Normal file
5
Task/HTTP/Gastona/http.gastona
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#listix#
|
||||
|
||||
<main>
|
||||
LOOP, TEXT FILE, http://www.rosettacode.org
|
||||
, BODY, @<value>
|
||||
1
Task/HTTP/Halon/http.halon
Normal file
1
Task/HTTP/Halon/http.halon
Normal file
|
|
@ -0,0 +1 @@
|
|||
echo http("http://www.rosettacode.org");
|
||||
13
Task/HTTP/Kotlin/http.kotlin
Normal file
13
Task/HTTP/Kotlin/http.kotlin
Normal 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()
|
||||
}
|
||||
1
Task/HTTP/NewLISP/http.newlisp
Normal file
1
Task/HTTP/NewLISP/http.newlisp
Normal file
|
|
@ -0,0 +1 @@
|
|||
(get-url "http://www.rosettacode.org")
|
||||
6
Task/HTTP/OoRexx/http.rexx
Normal file
6
Task/HTTP/OoRexx/http.rexx
Normal 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
|
||||
|
|
@ -1 +0,0 @@
|
|||
<@ SAYURLLIT>http://rosettacode.org/wiki/Main_Page</@>
|
||||
|
|
@ -1 +0,0 @@
|
|||
<# SAY URLSOURCE LITERAL>http://rosettacode.org/wiki/Main_Page</#>
|
||||
|
|
@ -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
14
Task/HTTP/Zkl/http.zkl
Normal 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);
|
||||
Loading…
Add table
Add a link
Reference in a new issue