[Youtube] Subscribers counter [solved]
LabyStudio 13 Jul 2013
[Youtube] Subscribers counter
solved.
solved.
-- 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->([^<]*)]]))
LabyStudio 13 Jul 2013
Grim Reaper 13 Jul 2013
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.
Bubba 13 Jul 2013
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:
So get the page text and run a simple regex match on it:
Which will print out: "Subscribers -> 36"
<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"
LabyStudio 15 Jul 2013
Bubba, on 13 July 2013 - 10:15 PM, said:
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:
So get the page text and run a simple regex match on it:
Which will print out: "Subscribers -> 36"
<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;)