Advertisement
RyuuzakiJulio

Youtube Subs

Mar 8th, 2014
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.39 KB | None | 0 0
  1.     youtuber = "AngelMalusPlays"
  2.     http.request("http://gdata.youtube.com/feeds/api/users/"..youtuber)
  3.     local requesting = true
  4.      
  5.     while requesting do
  6.      local event, url, sourceText = os.pullEvent()
  7.      if event == "http_success" then
  8.       local respondedText = sourceText.readAll()
  9.        p = string.find(respondedText,"subscriberCount='")
  10.        e = string.find(respondedText,"' videoW")
  11.        subs = string.sub(respondedText,p+17,e-1)
  12.        requesting = false
  13.       elseif event == "http_failure" then
  14.        print("Server didn't respond")
  15.        requesting = false
  16.       end
  17.     end
  18.  
  19. uni={
  20.  1+2+4+8+16+32, --0
  21.  3, --1
  22.  32+1+64+8+4, --2
  23.  32+1+64+2+4, --3
  24.  1+64+16+2, --4
  25.  32+16+64+2+4, --5
  26.  32+16+8+2+4+64, --6
  27.  35, --7
  28.  1+2+4+8+16+32+64, --8
  29.  32+16+64+1+2, --9
  30. }
  31.  
  32. dec={
  33.  4096+128+256+512+1024+2048,
  34.  128+256,
  35.  4096+128+8192+1024+512,
  36.  4096+128+8192+256+512,
  37.  2048+8192+128+256,
  38.  4096+2048+8192+256+512,
  39.  4096+2048+1024+512+256+8192,
  40.  4096+128+256,
  41.  4096+128+256+512+1024+2048+8192,
  42.  4096+2048+8192+128+256,
  43. }
  44.  
  45. prs ={
  46.  
  47. }
  48.  
  49. k=1
  50. for i=1,10 do
  51.  for j=1,10 do
  52.   prs[k]=uni[j]+dec[i]
  53.   k=k+1
  54.  end
  55. end
  56.  
  57. space = ""
  58. if subs < 1000 then space = "0" end
  59. if subs < 100 then space = "00" end
  60. if subs < 10 then space = "000" end
  61.  
  62. subs = space+subs
  63.  
  64. print(subs)
  65.  
  66.  
  67. -- rs.setBundledOutput("left",prs[h])
  68. -- rs.setBundledOutput("right",prs[m])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement