38 posts
Posted 13 July 2013 - 09:33 AM
[Youtube] Subscribers countersolved.
-- code by Bubba
local page = http.get("http://www.youtube.com/channel/NAME") --#Some channel
local text = page.readAll()
print("Subscribers -> "..text:match([[subscribed"%s->([^<]*)]]))
1114 posts
Location
UK
Posted 13 July 2013 - 10:40 AM
38 posts
Posted 13 July 2013 - 10:47 AM
yes, but I don't understand how I let it show only the subscribers
504 posts
Location
Seattle, WA
Posted 13 July 2013 - 05:45 PM
Apparently, you'll need to register your application with Google if you want to use their client-side API for interaction with your YouTube account. However, you could probably just download the page-source for a YouTube account and parse out the subscription count.
1190 posts
Location
RHIT
Posted 13 July 2013 - 11:15 PM
It's pretty simple if all you need is the subscribed amount. If you take a look in the source code of the page, you'll see something like this:
<span class="yt-subscription-button-subscriber-count-branded-horizontal subscribed">36</span>
So get the page text and run a simple regex match on it:
local page = http.get("http://www.youtube.com/channel/UC83CJDRvam3_3VKK2L52x9g") --#Some channel
local text = page.readAll()
print("Subscribers -> "..text:match([[subscribed"%s->([^<]*)]]))
Which will print out: "Subscribers -> 36"
38 posts
Posted 15 July 2013 - 10:27 AM
It's pretty simple if all you need is the subscribed amount. If you take a look in the source code of the page, you'll see something like this:
<span class="yt-subscription-button-subscriber-count-branded-horizontal subscribed">36</span>
So get the page text and run a simple regex match on it:
local page = http.get("http://www.youtube.com/channel/UC83CJDRvam3_3VKK2L52x9g") --#Some channel
local text = page.readAll()
print("Subscribers -> "..text:match([[subscribed"%s->([^<]*)]]))
Which will print out: "Subscribers -> 36"
thank you;)