Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.wrap("back") -- S??lectionez le cot?? de votre ??cran :3
- term.redirect(mon)
- os.loadAPI("json")
- term.clear()
- term.setTextColor(colors.gray)
- print("Obtention des tweets en cours... Merci de patienter")
- term.setCursorPos(3,1)
- Incr = 0
- term.setBackgroundColor( colors.black )
- while true do
- local contenu = http.get("http://theo33500.tech/toath/twitteroauth/test.php")
- --Ici changer Bill par le pseudo a surveiller.
- while contenu == nil do
- if Int == nil then
- Int = 0
- end
- term.clear()
- term.setTextColor(colors.gray)
- term.setCursorPos(3,1)
- print("Impossible d'obtenir les tweets.. Nouvelle tentative")
- Int = Int + 1
- sleep(2)
- contenu = http.get("http://theo33500.tech/toath/twitteroauth/test.php")
- if Int == 10 then
- redstone.setOutput("top", true)
- error("Impossible d'obtenir les tweets")
- end
- end
- local data = contenu.readAll()
- decode = json.decode(data)
- i = 10
- ii = 0
- while ii <= 10 do
- if decode.statuses[i] ~= null then
- local text = decode.statuses[i].text
- text = text:gsub("u00e9","e")
- text = text:gsub("u00e0","a")
- text = text:gsub("u00a0"," ")
- local from = decode.statuses[i].user.name
- local at = decode.statuses[i].user.screen_name
- local long = string.len(from)
- local I = 74 - long
- --if from = ModFriends_
- -- color = colors.white
- --end
- if Incr==0 then
- color = colors.orange
- elseif Incr == 1 then
- color = colors.orange
- elseif Incr == 2 then
- color = colors.magenta
- elseif Incr == 3 then
- color = colors.yellow
- elseif Incr == 4 then
- color = colors.lime
- elseif Incr == 5 then
- color = colors.pink
- elseif Incr == 6 then
- color = colors.gray
- elseif Incr == 7 then
- color = colors.cyan
- elseif Incr == 8 then
- color = colors.purple
- elseif Incr == 9 then
- color = colors.blue
- elseif Incr == 10 then
- color = colors.brown
- elseif Incr == 11 then
- color = colors.green
- else
- Incr = 0
- end
- Incr = Incr + 1
- if at == "theo33500" then
- color = colors.white
- end
- term.setTextColor(color)
- print("+--------------------------------------------------------------------------------+")
- print("+\n+ "..text)
- write("+\n+ de : " ..from)
- print("+--------------------------------------------------------------------------------+")
- end
- i = i - 1
- ii = ii + 1
- sleep(0.1)
- end
- sleep(45)
- end
Advertisement
Add Comment
Please, Sign In to add comment