Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local internet = require("internet")
- local object = require("object")
- local Request = require("Request")
- local Parser = require("Parser")
- local request = object(Request)
- local pastebin = object(Parser, "http://www.pastebin.com")
- function pastebin.user_index(html)
- local file_list = {}
- for line in html:between('<table class="maintable">', '</table>') do
- local id, name = line:match('<a href="/(%w+)">(%g+)</a>')
- table.insert(file_list, {
- name = name;
- url = string.format(self.url .. '/raw/%s', id)
- })
- end
- return file_list
- end
- request:update(pastebin.user_index, '/u/throwawayrobot', function(files)
- for n, file in files do
- print(n, file.name, file.url)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement