Advertisement
Guest User

Twitter notch computercraft 1

a guest
Aug 23rd, 2014
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local mon = peripheral.wrap("top") -- 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 GET v2.1")
  7. term.setCursorPos(3,1)
  8.      
  9. while true do
  10.   local contenu = http.get("http://goofyplace.org/Black/twitter/request.php?user=Markus Persson")
  11.   --Ici changer Bl4ckWare par le pseudo a surveiller.
  12.   local data = contenu.readAll()
  13.   decode = json.decode(data)
  14.   i = 10
  15.     while i <= 10 do
  16.       if decode.statuses[i] ~= null then
  17.         term.setTextColor(colors.white)
  18.          local text = decode.statuses[i].text
  19.          text = text:gsub("u00e9","e")
  20.          text = text:gsub("u00e0","a")
  21.          text = text:gsub("u00a0"," ")
  22.         print("\n "..text)
  23.         term.setTextColor(colors.orange)
  24.         print(" from : " ..decode.statuses[i].user.name)
  25.       end
  26.     i = i - 1
  27.     sleep(0.1)
  28.     end
  29.     sleep(60)
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement