Advertisement
Akuukis

Screep highscore crawler

Jun 17th, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. #!/usr/local/bin lua
  2.  
  3. -- usage:
  4. -- lua screepHighscores.lua savedHtmlOfScreepHighscoresPage.html
  5.  
  6. local f = assert(io.open(arg[1], "r"))
  7. local s = f:read("all")
  8. f:close()
  9.  
  10. local board = assert(io.open("/home/kalvis/screepScores.log", "a+"))
  11.  
  12. for name, score in string.gmatch(s,".-\"#!/profile/(%w+).-binding\">(.-)<") do
  13.     board:write(os.date("%y-%m-%d %H:%M"), "\t", score, "\t", name, "\n")
  14.     print(os.date("%y-%m-%d %H:%M"), score, name)
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement