Advertisement
william200027

Twitter

Apr 11th, 2016
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.02 KB | None | 0 0
  1. local mon = peripheral.wrap("back") -- Sélectionez le coté de votre écran :3
  2. term.redirect(mon)
  3. os.loadAPI("json")
  4. term.clear()
  5. term.setTextColor(colors.gray)
  6. print("Twitter crée par minsto")
  7. term.setCursorPos(3,1)
  8. Incr = 0
  9.  
  10.  
  11. while true do
  12.  
  13.   local contenu = http.get("http://goofyplace.org/Black/twitter/request.php?user=jeb")
  14.   --Ici changer Bill par le pseudo a surveiller.
  15.   local data = contenu.readAll()
  16.  
  17.   decode = json.decode(data)
  18.   i = 10
  19.   ii = 0
  20.  
  21.     while ii <= 10 do
  22.       if decode.statuses[i] ~= null then
  23.          local text = decode.statuses[i].text
  24.          text = text:gsub("u00e9","e")
  25.          text = text:gsub("u00e0","a")
  26.          text = text:gsub("u00a0"," ")
  27.         local from = decode.statuses[i].user.name
  28.         local long = string.len(from)
  29.         local I = 74 - long
  30.        
  31.       if Incr==0 then
  32.         color = colors.white
  33.       elseif Incr == 1 then
  34.         color = colors.orange
  35.       elseif Incr == 2 then
  36.         color = colors.magenta
  37.       elseif Incr == 3 then
  38.         color = colors.yellow
  39.       elseif Incr == 4 then
  40.         color = colors.lime
  41.       elseif Incr == 5 then
  42.         color = colors.pink
  43.       elseif Incr == 6 then
  44.         color = colors.gray
  45.       elseif Incr == 7 then
  46.         color = colors.cyan
  47.       elseif Incr == 8 then
  48.         color = colors.purple
  49.       elseif Incr == 9 then
  50.         color = colors.blue
  51.       elseif Incr == 10 then
  52.         color  = colors.brown
  53.       elseif Incr == 11 then
  54.         color = colors.green
  55.       else
  56.         Incr = 0
  57.       end
  58.  
  59.  
  60.     Incr = Incr + 1
  61.     term.setTextColor(color)
  62.          print("----------------------------------------------------------------------------------")
  63.         print("\n "..text)
  64.         write("\n from : " ..from)
  65.         while I > 0 do
  66.             write("-")
  67.             I = I - 1
  68.         end
  69.         print("\n ")
  70.       end
  71.  
  72.     i = i - 1
  73.     ii = ii + 1
  74.     sleep(0.1)
  75.     end
  76.  
  77.     sleep(60)
  78. end
  79.  
  80. ----=Autor=----
  81. --By Zaidal86
  82. ----=-----=----
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement