Jump to content
UBot Underground

Recommended Posts

I want to extract the asin number from an amazon url so

 

http://www.amazon.com/exec/obidos/asin/BGHT0005/trackingid-20

 

the asin would be BGHT0005

 

I want to extract the asin from the above amazon url and add ##### after the asin.

 

I know I can do this with $replace but think it would be cleaner with regex.

 

Thanks for the help

Link to post
Share on other sites

thanks willywonka for your help. I ended up watching some tutorials and found I could get the asin by this regex:

 

B\w+

 

so something like this:

 

set(#asin, $find regular expression($scrape attribute($element offset(<class="getbook">, #counter), "href"), "B\\w+"), "Global")

 

then I just append the pound signs to the end of it in the set command or when I add it to the list.

  • Like 1
Link to post
Share on other sites
  • 2 years later...
  • 1 month later...

Can anyone update this 

 

http://www.amazon.com/gp/aw/d/B000M5NPKU/ref=mp_s_a_1_1?qid=1416838573&sr=8-1

 

how do i get ASIN number of of these links?

B\w+ seems to work in regex..  Im not sure what "flavor" ubot recognizes regex... Ive used the following in php coding and others: \/[A-Z][0-9]{10}  Note... the \/ in the beginning of the expression is a backslash and forward slash, not the letter V.

Ive tried the code in ubot 4 just a short bit ago and it will not accept the {10} variable. It keeps changing it to 10 and removing the symbols, also adding forward slashes. Perhaps you can buy the php plugin and run the regex in it, thus giving you the result you need. Im trying to build my own php plugin, so perhaps i can distribute that for free here on ubot.

 

Ill try it in UBOT 5 and see if the regex works there.

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