Advertisement
HowToRoblox

ChannelStatsHandler

Mar 18th, 2020
1,397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. local httpService = game:GetService("HttpService")
  2.  
  3. local id = "UCE4hHKx3Qnwo4vz-26xiX0Q"
  4.  
  5.  
  6. while wait(5) do
  7.    
  8.     local link = httpService:GetAsync("https://www.googleapis.com/youtube/v3/channels?part=statistics&id=" .. id .. "&key=AIzaSyD8Mru34qlgyVISGybnidJkqjwr-fzxlsQ")
  9.    
  10.     local dataFromLink = httpService:JSONDecode(link)
  11.    
  12.    
  13.     local subs = tostring(dataFromLink.items[1].statistics.subscriberCount)
  14.    
  15.     local views = tostring(dataFromLink.items[1].statistics.viewCount)
  16.    
  17.     local uploads = tostring(dataFromLink.items[1].statistics.videoCount)
  18.  
  19.  
  20.     script.Parent.Subs.Text = "Subscribers: " .. subs
  21.    
  22.     script.Parent.Views.Text = "Views: " .. views
  23.    
  24.     script.Parent.Uploads.Text = "Uploads: " .. uploads
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement