Created
January 18, 2016 06:28
-
-
Save gr33n7007h/0e16f06bfcd98b9a6d05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env lua | |
local socket = require('socket') | |
local s = assert(socket.tcp()) | |
s:connect('www.google.co.uk', 80) | |
s:send('GET /robots.txt HTTP/1.1\r\n\r\n') | |
while true do | |
local line = s:receive('*l') | |
if line:match('Disallow: (.+)') then | |
local path = line:match('Disallow: (.+)') | |
print('path: ' .. path) | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment