Jump to content
UBot Underground

How To Load A List Of Urls Into Ubot And Execute A Bot Routine For Every Given Url


Recommended Posts

Hi Fellow Botters,

 

as I am pretty new to ubot I am facing a general problem of not knowing how to implement the following.

 

What I try to achieve is:

1.) I provide a list of URLs within a TXT file or CSV

2.) The bot should load the list after start

3.) The bot should execute a normal ubot script but for each URL only once

4.) After executing the script (or loop) for all the given URLs, we take the result data and store it as CSV or TXT

 

What I need most help with are step 2 and 3. Mayve I miss an idea how to tell the bot take each from TXT list and loop ubot script until all urls are processed.

 

If anyone can give me a headstart on how to achieve this would be awesome..

 

Thanks!

Edited by PRO
Link to post
Share on other sites

Here you go

ui open file("List of urls",#urls)
comment("Make sure they uploaded a list of urls, let them know if they didn\'t!")
if($is blank(#urls)) {
    then {
        alert("Please load a list of urls first")
        stop script
    }
    else {
    }
}
comment("Make sure your lists and tables get cleared out before each run to avoid problems
if they decide to use the program over and over")
clear list(%urls)
add list to list(%urls,$list from file(#urls),"Delete","Global")
clear table(&data)
comment("Set the table row number, we will use this in the \"Set Table Cell\"
commands below

Number starts at 0 because 0 is the first number counted in programming
so row 0 is the first row and 1 is the second and so on")
set(#row,0,"Global")
comment("List total is the number of items in the list if we loop for the list total
then it will automatically loop for the correct number")
loop($list total(%urls)) {
    comment("Use next list item to get the next item in the list automatically")
    navigate($next list item(%urls),"Wait")
    set table cell(&data,#row,0,$url)
    set table cell(&data,#row,1,$title)
    set table cell(&data,#row,2,$meta description)
    set table cell(&data,#row,3,$meta keywords)
    comment("Increment the row number now so that in the CSV file the
next website info will be stored on the next line")
    increment(#row)
}
set(#save_location,"{$special folder("Desktop")}\\Data.csv","Global")
save to file(#save_location,&data)
alert("Website info saved to {#save_location}")

  • Like 3
Link to post
Share on other sites

I just reloaded this page here on the forum and BOOOOOM! The detailled and exact plan to achieve is flying in!

 

You are a bomb @HelloInsomnia for a ninja fast termination of my unwanted problem. If it works ;)

 

Have many thanks!

 

P.S.: I wanted to press "LIKE" for your answer but unfortunately the forum tells me: 

 

An error occurred

You have reached your quota of positive votes for the day

I will virtually thank you tomorrow then  :rolleyes:

Edited by PRO
  • Like 1
Link to post
Share on other sites

 

Here you go

ui open file("List of urls",#urls)
comment("Make sure they uploaded a list of urls, let them know if they didn\'t!")
if($is blank(#urls)) {
    then {
        alert("Please load a list of urls first")
        stop script
    }
    else {
    }
}
comment("Make sure your lists and tables get cleared out before each run to avoid problems
if they decide to use the program over and over")
clear list(%urls)
add list to list(%urls,$list from file(#urls),"Delete","Global")
clear table(&data)
comment("Set the table row number, we will use this in the \"Set Table Cell\"
commands below

Number starts at 0 because 0 is the first number counted in programming
so row 0 is the first row and 1 is the second and so on")
set(#row,0,"Global")
comment("List total is the number of items in the list if we loop for the list total
then it will automatically loop for the correct number")
loop($list total(%urls)) {
    comment("Use next list item to get the next item in the list automatically")
    navigate($next list item(%urls),"Wait")
    set table cell(&data,#row,0,$url)
    set table cell(&data,#row,1,$title)
    set table cell(&data,#row,2,$meta description)
    set table cell(&data,#row,3,$meta keywords)
    comment("Increment the row number now so that in the CSV file the
next website info will be stored on the next line")
    increment(#row)
}
set(#save_location,"{$special folder("Desktop")}\\Data.csv","Global")
save to file(#save_location,&data)
alert("Website info saved to {#save_location}")

 

HelloInsomnia, your given script works perfectly without modification.

 

Also it explains the whole process of how ubot logic is handling such routines known from common programming languages.

 

Thanks mate! I salute you  B)

Link to post
Share on other sites

ui block text("urls - one per line",#urls)
add list to list(%url_list,$list from text(#urls,$new line),"Delete","Global")
with each(%url_list,#current_url) {
    navigate(#current_url,"Wait")
    wait for browser event("Everything Loaded","")
    comment("Now it has loaded a url - Tell it what to do under this comment box")
    set(#my_results,$title,"Global")
    add list to list(%titles,$list from text(#my_results,$new line),"Delete","Global")
}

save to file("{$special folder("Desktop")}\\my-ubot-stuff.txt",%titles)

Link to post
Share on other sites

Haha, welcome to developers heaven, to prepare for the market hell out there - where incoming special forces jump in to save your day  :ph34r: 

 

Awesome, thanks for also sharing your style of Kung Fu, Mr. Brutal Lee  :D

 

 

P.S.: I wanted to press "LIKE" for your answer but unfortunately the forum tells me: 

 

An error occurred

You have reached your quota of positive votes for the day

I will virtually thank you tomorrow then   :rolleyes:

Edited by PRO
Link to post
Share on other sites
  • 6 months later...

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...