Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- local h = fs.open(tArgs[1],"r")
- local html = h.readAll()
- h.close()
- local headers = {}
- local bodies = {}
- local both = {}
- html:gsub("<(.-)>",function(a) table.insert(headers,a) end)
- html:gsub(">(.-)<",function(a) table.insert(bodies,a) end)
- for _,i in ipairs(headers) do
- for _,v in ipairs(bodies) do
- both[i]=v
- end
- end
- print(#headers)
- for i=1,#headers do
- if headers[i] == "h1" then term.setTextColor("blue")
- print(bodies[i])
- end
- if headers[i] == "p" then term.setTextColor("green")
- print(bodies[i])
- end
- end
- --[[for i,v in pairs(both) do
- write(i.." "..v)
- end]]--
- --print(body)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement