Jump to content
UBot Underground

Cleaning Your Data With Ubot... Possible?


Recommended Posts

I was just wondering if it's possible to clean your data with UBot? 

 

For example, say you have a list with mostly the same URLs, but some of those URLs are also from different domains. Can you tell UBot to remove URLs from the list if they don't contain 'google.com'? How would this look in code?

Link to post
Share on other sites

A few ways to do it but I think you will find using a second list is the easiest:

clear list(%urls)
add list to list(%urls,$list from text("http://yahoo.com,http://google.com,http://pinterest.com,http://ubotstudio.com",","),"Delete","Global")
clear list(%urls_cleaned)
loop($list total(%urls)) {
    set(#list_item,$next list item(%urls),"Global")
    if($contains(#list_item,"google.com")) {
        then {
            add item to list(%urls_cleaned,#list_item,"Don\'t Delete","Global")
        }
        else {
        }
    }
}
Link to post
Share on other sites

OMG thank you so much! That works perfectly and really saves me some time scraping data. 

 

Is it also possible just to clean the 'urls' list without making another list? I know you said the way above it likely easiest, but I like to know other ways to do things as well. 

Edited by awesome sauce
Link to post
Share on other sites

Give this a try:

clear list(%urls)
add list to list(%urls,$list from text("http://yahoo.com,http://google.com,http://pinterest.com,http://ubotstudio.com",","),"Delete","Global")
loop($list total(%urls)) {
    set(#list_item,$next list item(%urls),"Global")
    if($contains(#list_item,"google.com")) {
        then {
        }
        else {
            set list position(%urls,$subtract($list position(%urls),1))
            remove from list(%urls,$list position(%urls))
        }
    }
}
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...