theo33500

ModFriends V2

Oct 2nd, 2016 (edited)
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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("Obtention des tweets en cours... Merci de patienter")
  7. term.setCursorPos(3,1)
  8. Incr = 0
  9. term.setBackgroundColor( colors.black )
  10.  
  11. while true do
  12.   redstone.setOutput("top", false)
  13.   local contenu = http.get("https://theo33500.xyz/toath/twitteroauth/test.php")
  14.   --Ici changer Bill par le pseudo a surveiller.
  15.  while contenu == nil do
  16.   if Int == nil then
  17.    Int = 0
  18.   end
  19.   term.clear()
  20.   term.setTextColor(colors.gray)
  21.   term.setCursorPos(3,1)
  22.   print("Impossible d'obtenir les tweets.. Nouvelle tentative")
  23.   Int = Int + 1
  24.   sleep(2)
  25.   contenu = http.get("http://theo33500.xyz/toath/twitteroauth/test.php")
  26.   if Int == 10 then
  27.   error("Impossible d'obtenir les tweets")
  28.   end
  29.  end
  30.    
  31.     local data = contenu.readAll()
  32.  
  33.   decode = json.decode(data)
  34.   i = 10
  35.   ii = 0
  36.  
  37.     while ii <= 10 do
  38.       if decode.statuses[i] ~= null then
  39.          local text = decode.statuses[i].text
  40.         local from = decode.statuses[i].user.name
  41.         local team = "null"
  42.          text = text:gsub("u00e9","e")
  43.          text = text:gsub("u00e0","a")
  44.          text = text:gsub("u00a0"," ")
  45.         text = text:gsub("u00e8","e")
  46.         text = text:gsub("u00e1","a")
  47.         text = text:gsub("u00ea","e")
  48.         from = from:gsub("ud83dudd25","*flamme*")
  49.         local at = decode.statuses[i].user.screen_name
  50.         local long = string.len(from)
  51.         local I = 74 - long
  52.  
  53. --if from = ModFriends_
  54. --  color = colors.white
  55. --end
  56.                        
  57.        
  58. if at == "Theo33500" then
  59.   team = "creative"
  60. end
  61.  
  62. if at == "TheNyoFR" then
  63.   team = "iliad"
  64. end
  65.  
  66. if at == "leonekmi" then
  67.   team = "creative"
  68. end
  69.  
  70. if at == "Luclu7Gaming" then
  71.   team = "iliad"
  72. end
  73.  
  74. if at == "ajen003" then
  75.   team = "flip flip crou"
  76. end
  77.  
  78. if at == "Satanpasmechant" then
  79.   team = "flip flip crou"
  80. end
  81.  
  82. if at == "Lozzydud" then
  83.   team = "noteam"
  84. end
  85.  
  86. if at == "r33int" then
  87.   team = "iliad"
  88. end
  89.  
  90. if at == "Mod_Friends" then
  91.   team = "twitter"
  92. end
  93.  
  94. if team == "creative" then
  95.   color = colors.orange
  96. end
  97.  
  98. if team == "capitaliste" then
  99.   color = colors.green
  100. end
  101.  
  102. if team == "iliad" then
  103.   color = colors.red
  104. end
  105.  
  106. if team == "flip flip crou" then
  107.   color = colors.pink
  108. end
  109.  
  110. if team == "noteam" then
  111.   color = colors.white
  112. end
  113.  
  114. if team == "twitter" then
  115.   color = colors.blue
  116. end
  117.  
  118. if team == "null" then
  119.   color = colors.gray
  120. end
  121.  
  122. term.setTextColor(color)
  123.          print("+--------------------------------------------------------------------------------+")
  124.         print("+\n+ "..text)
  125.         write("+\n+ de : " ..from.." @"..at)  
  126.         if team == "null" then
  127.  
  128.         else
  129.           write("\n+ team : "..team)    
  130.         end
  131.         print("+--------------------------------------------------------------------------------+")
  132.       end
  133.  
  134.     i = i - 1
  135.     ii = ii + 1
  136.     sleep(0.1)
  137.     end
  138.     redstone.setOutput("top", true)
  139.    
  140.     sleep(10)
  141.     term.clear()
  142.     term.setCursorPos(1,1)
  143. end
Advertisement
Add Comment
Please, Sign In to add comment