YAPC::EU 2018 Glasgow Update!

This commit is contained in:
Ingy döt Net 2018-08-17 15:15:24 +01:00
parent 22f33d4004
commit 4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions

View file

@ -1,18 +1,17 @@
'
' Read and display a website
'
SPLIT ARGUMENT$ BY " " TO arg$ SIZE dim
IF dim < 2 THEN
IF AMOUNT(ARGUMENT$) = 1 THEN
website$ = "www.basic-converter.org"
ELSE
website$ = arg$[1]
website$ = TOKEN$(ARGUMENT$, 2)
ENDIF
OPEN CONCAT$(website$, ":80") FOR NETWORK AS mynet
SEND CONCAT$("GET / HTTP/1.1\r\nHost: ", website$, "\r\n\r\n") TO mynet
OPEN website$ & ":80" FOR NETWORK AS mynet
SEND "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))
UNTIL ISFALSE(WAIT(mynet, 500))
CLOSE NETWORK mynet
PRINT total$

9
Task/HTTP/Phix/http.phix Normal file
View file

@ -0,0 +1,9 @@
include builtins\libcurl.e
curl_global_init()
atom curl = curl_easy_init()
curl_easy_setopt(curl, CURLOPT_URL, "http://rosettacode.org/robots.txt")
object res = curl_easy_perform_ex(curl)
curl_easy_cleanup(curl)
curl_global_cleanup()
puts(1,res)