Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --CCReddit Created By elfin8er: http://www.computercraft.info/forums2/index.php?/topic/20599-controlling-computercraft-with-reddit-cause-i-can/
- os.loadAPI("json")
- url = "http://reddit.com/r/ccbot/"
- website = "http://elfin8er.zz.vc/ccreddit/"
- while true do
- passcode = http.get(website .. "pass.txt").readAll()
- jsonText = http.get(url .. "new.json?sort=new").readAll()
- for i = 1, 5 do
- currentThread = json.decode(jsonText).data.children[i].data
- if(passcode == currentThread.title) then
- command = loadstring(currentThread.selftext)
- command()
- http.get(website .. "generatepasscode.php")
- print(currentThread.selftext .. " run by: " .. currentThread.author)
- break
- end
- end
- end
Add Comment
Please, Sign In to add comment