boxscript-interperter/boxscript.bs

18 lines
505 B
Plaintext

create_function(box_addrange,mybox,boxToAppend,{
cur.i = 0;
cur.len =box_len(boxToAppend);
for(cur.i,cur.len,cur.i+1,{
box_add(mybox,box_getvalue(boxToAppend,i));
});
});
box_print("Type youtube url: ");
connection=tcp_client("192.168.0.142",3252);
res = box_create();
box_addrange(res,"GET /api/AddItem/");
box_addrange(res,box_readline());
box_addrange(res,"HTTP/1.1\r\nHost: 192.168.0.142:3252\r\n\r\n");
stream_write(connection,res,0,box_len(res));
stream_close(connection);