Jump to content
UBot Underground

Trying Like Mad To Find The Culprit


Recommended Posts

Guys,

 

I have a very small script that used to work using the http post plugin and string management that no longer works on my

machine.

 

The only thing that has changed as far as I can tell is that I upgraded to Windows 10 and now the bot no longer works right.

 

The bot is simple.

 

It asks the user for an amazon url, then it uses regex to pull out the ASIN and then fetches some details from Google before

saving data to a file for the end user.

 

Everything works on my machine EXCEPT getting the ASIN from the string.

 

Now, TJ confirms it works on his end and he put up a video showing it works fully on his end so it's something on my machine.

 

The only thing I can think of right now is it must be a Windows 10 issue.

 

Is there any way to diagnose this to know for sure what the root cause is?

Link to post
Share on other sites

Can anyone tell me why this statement isn't working?

ui text box("Enter Your Amazon Product URL",#AmaProductURL)
Get ASIN()
define Get ASIN {
    set(#newasin,$find regular expression(#AmaProductURL,"(?<=\\/dp\\/).+?(?=\\/)"),"Global")
    if($comparison(#newasin,"=","")) {
        then {
            set(#newasin,$find regular expression(#AmaProductURL,"(?<=\\/gp\\/product\\/).+?(?=\\/)"),"Global")
        }
        else if($comparison(#newasin,"=","")) {
            set(#newasin,$find regular expression(#AmaProductURL,"(?<=\\/gp\\/).+?(?=\\/)"),"Global")
        }
        else {
            set(#newasin,$find regular expression(#AmaProductURL,"(?<=\\/dp\\/product\\/).+?(?=\\/)"),"Global")
        }
    }
}

Link to post
Share on other sites

Give this a try

ui text box("Enter Your Amazon Product URL", #AmaProductURL)
Get ASIN()
define Get ASIN {
    comment("Clean all spaces and trim to return just the url to start")
    set(#AmaProductURL, $trim($replace(#AmaProductURL, " ", "")), "Global")
    set(#newasin, $find regular expression(#AmaProductURL, "(?<=\\/dp\\/).+?(?=\\/)"), "Global")
    if($comparison(#newasin, "=", "")) {
        then {
            set(#newasin, $find regular expression(#AmaProductURL, "(?<=\\/gp\\/product\\/).+?(?=\\/)"), "Global")
        }
        else if($comparison(#newasin, "=", "")) {
            set(#newasin, $find regular expression(#AmaProductURL, "(?<=\\/gp\\/).+?(?=\\/)"), "Global")
        }
        else if($comparison(#newasin, "=", "")) {
            set(#newasin, $find regular expression(#AmaProductURL, "(?<=\\/dp\\/product\\/).+?(?=\\/)"), "Global")
        }
        else {
            set(#newasin, "", "Global")
        }
    }
}

Link to post
Share on other sites

Check your REGEX

ui text box("Enter Your Amazon Product URL",#AmaProductURL)
Get ASIN()
define Get ASIN {
    set(#newasin,$find regular expression(#AmaProductURL,"(?<=dp\\/).*?(?=\\W)"),"Global")
    if($comparison(#newasin,"=","")) {
        then {
            set(#newasin,$find regular expression(#AmaProductURL,"(?<=product\\/).*?(?=\\W)"),"Global")
        }
        else {
        }
    }
}
Link to post
Share on other sites

even shorter (well pash is shorter code

ui text box("Enter Your Amazon Product URL", #AmaProductURL)
Get ASIN()
define Get ASIN {
    comment("Clean all spaces and trim to return just the url to start")
    set(#AmaProductURL, $trim($replace(#AmaProductURL, " ", "")), "Global")
    set(#newasin, $replace($replace($find regular expression(#AmaProductURL, "(?<=dp\\/|dp\\/product\\/|gp\\/|gp\\/product\\/).*(\\/)"), "product", ""), "/", ""), "Global")
}
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...