Jump to content
UBot Underground

Question About Youtube And Acting On Views (If Then Statement)


Recommended Posts

Hi Everyone,

 

I'm still a big noob with Ubot but I'm trying to make it work the best as I can.

 

I took most uBot tutorials but was not able to find how to resolve the next, can someone help me or guide me to a video/guide that shows me how I can do it?

 

Case:

 

I want the bot to check the number of views a channel admin has, then if the number of views, for instance, are below 100.000 I want to send them a message. If the number is above 100k it needs to go to the next list item.

 

The message part I figured out, but not how to create a way to see the views properly and do a sort of comparison with it so I can explain the uBot that it needs to send the message or skip the channel..

 

Who can help?

 

The views can be found on the About page of a channel.


 

The outcome when I scrape the views attribute is this: <b> 6,687,063 <b> views

 

Can you also tell/explain how I only get the views and not all the other jibberish information?

 

* I wanted to add the code but I can't because the website gives me an error message that my account is blocked or something?

Edited by scrapelicious
Link to post
Share on other sites

Do not try in that way ,try with http plugin if you don't want to buy it then try heopas http plugin it's free and going to serve your purpose. First scrape html document >> store in a variable >> use regex to find views .

set condition if( views<10k){send mesage}

else

{

navigate(go to next list item)

}

like that

hope it helps you

pm skype id-  live:69f5974a7e15e93e

Edited by tinku
Link to post
Share on other sites

navigate("https://www.youtube.com/channel/UCbBnnIbgqSwtXfVKug8PUjg/about?disable_polymer=1","Wait")
set(#raw veiws,$scrape attribute(<innerhtml=w" • <b>*</b> views">,"innertext"),"Global")
set(#final number,$find regular expression(#raw veiws,".(?<=.*\\s).*(?=\\sviews)"),"Global")
if($comparison(#final number,"> Greater than",15000000)) {
    then {
        alert("greater")
    }
    else {
        alert("less")
    }
}

  • Like 1
Link to post
Share on other sites

navigate("https://www.youtube.com/channel/UCbBnnIbgqSwtXfVKug8PUjg/about?disable_polymer=1","Wait")

set(#raw veiws,$scrape attribute(<innerhtml=w" • <b>*</b> views">,"innertext"),"Global")

set(#final number,$find regular expression(#raw veiws,".(?<=.*\\s).*(?=\\sviews)"),"Global")

if($comparison(#final number,"> Greater than",15000000)) {

    then {

        alert("greater")

    }

    else {

        alert("less")

    }

}

you can also try with xpath download heopas free plugin and try with that because ubot browser is not so stable the code like this:-

set(#xpath,$plugin function("XpathPlugin.dll", "$Generic Xpath Parser", $document text, "x://*[@id=\"browse-items-primary\"]/li/div/div[3]/div/span[2]/b", "innerhtml", ""),"Global")
and follow the logic as suggested by stanf
  • Like 1
Link to post
Share on other sites

i did not take into account the unstable nature of ubots browser ( i use xbrowser), i also use xpath builder both by dan (http://network.ubotstudio.com/forum/index.php/user/1200-bot-factory-dan/ )

 

also regex builder by helloinsomnia ( http://network.ubotstudio.com/forum/index.php/user/4934-helloinsomnia/).

save your pennies and grab all three items they will make your life easier.

ps.

this xpath code is shorter

(//span[contains(@class,"about-stat")])[2]

there are 3 classes "about-stat"

adding the Prentiss around the code and the brackets with the 2 in the middle  helps identify the second one,

tinku

codes his xpath by hand (i aint that smart), but both will grab the data that you want

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...