Jump to content
UBot Underground

Appending a Suffix To A URL List


Recommended Posts

I was wondering if someone could possibly offer some insight (in detail) as to how I go about this.

I really appreciate any help here cause I've been beating myself up on this for a few days

 

List A) I have a list of 270 URLs

List  B )   I also have a list of 128 unique suffixes to add (the number in List B changes and can be larger or smaller than List A)

 

So what I want to do is this:

 

1) Based upon the the TOTAL in LIST B = Randomly (possibly shuffle List A) and grab 128 URLs from List A

2) Now Append to the end of the 128 URLs from List A the 128 suffixes from List B

 

I know this is a form of concatenate BUT these are 2 unique lists that are scraped and I'm trying not to have to download to a file. I want to have the files concatenated within ubot while the program is running.

 

 

List A will look like:

 

http://cnn.com/

http://foxnews.com/

http://abc.com/

http://cbs.com/

http://nbc.com/

 

List B will book like:

 

2258

159

89654

 

So in this example the output will look like:

 

http://foxnews.com/2258

http://abc.com/159

http://cbs.com/89654


So what has to happen is based upon the fact there are (3) in List B - Ubot will Randomly select only (3) from List A and then append the digits from List B to the end of list A

 

******Notes: Sometimes the List B will have a greater quantity  and will have to RE-use List A until the complete List B is associated to a URL from List A
 

I'm not wanting any duplicate from List A UNLESS List B is larger than List A

 

Thanks so much!

Link to post
Share on other sites

Hello, check out the code below -This might be what you're looking for. As I Am quite new to Ubot - therefore the code is rather long - (and may not work in all the situations you mention above, but it should give you some ideas at the least.. :)

 

 

add list to list(%ListA, $list from text("http://cnn.com/
http://foxnews.com/
http://abc.com/
http://cbs.com/
http://nbc.com/
http://xyz.com/", "
"), "Delete", "Global")
add list to list(%ListB, $list from text("2258
159
89654
3658
6598", "
"), "Delete", "Global")
clear list(%AplusB)
if($comparison($list total(%ListA), ">", $list total(%ListB))) {
    then {
        loop while($comparison($list total(%AplusB), "<", $list total(%ListB))) {
            add item to list(%AplusB, "{$next list item(%ListA)}{$next list item(%ListB)}", "Delete", "Global")
        }
    }
    else {
        loop($list total(%ListB)) {
            add item to list(%AplusB, "{$next list item(%ListA)}{$next list item(%ListB)}", "Delete", "Global")
            if($comparison($list position(%ListA), "=", $list total(%ListA))) {
                then {
                    set list position(%ListA, 0)
                }
            }
        }
    }
}

Edited by Sanjeev
  • 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...