Gothic Online Forums
[0.1.*] getHTML - Printable Version

+- Gothic Online Forums (https://archive.gothic-online.com)
+-- Forum: Scripting (English) (https://archive.gothic-online.com/forum-11.html)
+--- Forum: Resources (https://archive.gothic-online.com/forum-14.html)
+---- Forum: Scripts (https://archive.gothic-online.com/forum-17.html)
+---- Thread: [0.1.*] getHTML (/thread-2081.html)



[0.1.*] getHTML - Marcel - 23.05.2017

Code:
function getHTML(link, ...){
       local trying = 3, output = null;
       if(vargv.len()>0) trying = vargv[0];
       system(format("wget -t %d -O getHTML -a getHTMLLog %s -q -F", trying, link));
       local file = io.file("getHTML", "r");
       if(file.isOpen){
           output = file.read(io_type.ALL);
           file.close();
       }
       system("rm getHTML");
       return output;
}

local servers = getHTML("http://185.5.97.181:8000/master/public_servers/");

Simple script to download html code with any www. it using only wget for GNU/Linux. Published as curiosity.