Thank you @kfrajer I already check it out but I don’t have idea about how can I use it . It’s because I’m asking for some help.
Can you @kfrajer send me some example? I tried with regular expressions using loadString() and indexOf(…) but I can’t make it work. @TfGuy44
This was my code.
void draw()
{
background(20);
textAlign(CENTER);
textSize(width*0.2);
String[] web = loadStrings("https://www.youtube.com/channel/UCy0YHkGM8szRMOhIkNUFwiA?view_as=subscriber"); // My Youtube profile link
String HTML = join(web,""); //Join all HTML code as a string
String start = "<yt-formatted-string id=\"subscriber-count\" class=\"style-scope ytd-c4-tabbed-header-renderer\">";
String end = " suscriptores</yt-formatted-string>";
String subs = giveMeTextBetween(HTML,start,end);
println(subs);
//text("100K",width/2,height/2+200);
}
String giveMeTextBetween(String s, String before, String after)
{
String found = "";
int start = s.indexOf(before);
if(start == -1){return "Start Error";}; //If we don't find anything , send back a blank String
start += before.length(); // Move to the end of the beginning tag
int end = s.indexOf(after,start);
if(end == -1){return "End Error";};
return s.substring(start,end); //Return the text in between
}
If any body can bring me some example about how to use the youtube API library or some functions It would be a great help for me, I am a beginner, Thanks guys
A good explanation by The Coding Train here.
You might want to take a look at the reference from loadJSONObject()
JSON is easier to parse than HTML. Here is the explanation of Google, how the JSON is built.
You didn’t say by which parameter you get the channel. Probably you want this by Username, but pick yourself a parameter here. Here is a quickstart for JAVA.
EDIT: A RPI 3 seems to be a bit overwhelming. A RPI Zero or Zero W could (probably) do it, too. But then i recommend to export it for Linux 32-bit.