Results 1 to 9 of 9
  1. #1
    Visual Artist & ABW Ambassador lostdeviant's Avatar
    Join Date
    September 7th, 2007
    Location
    Cuautitlán, Edo. de México
    Posts
    1,725
    Extract coupon codes from deal description?
    I noticed that some networks like CJ (if I remember correctly) aren't including coupon codes as a separate datafeed field, but I noticed some merchants including the coupon code in the deal description.

    How do you extract that code from the description for use as a variable ?

  2. #2
    Grandma broke her coccyx! Uncle Rico's Avatar
    Join Date
    May 8th, 2007
    Location
    North Carolina
    Posts
    2,238
    I parse the description field looking for certain text. When I find that text, I can then parse out the actual coupon code by using strpos and substr functions.

    I am looking for strings like "coupon code: " or "promo code ", etc.

  3. #3
    Visual Artist & ABW Ambassador lostdeviant's Avatar
    Join Date
    September 7th, 2007
    Location
    Cuautitlán, Edo. de México
    Posts
    1,725
    Thank you

  4. #4
    Grandma broke her coccyx! Uncle Rico's Avatar
    Join Date
    May 8th, 2007
    Location
    North Carolina
    Posts
    2,238
    Each time the script runs and finds a string that I do not have, I then identify that in the script and then go back and modify the script to add the new string in. At this point, I have about 30 else statements looking for various forms of "coupon code", "promo code", "w/code", "use code", "with code". There are a lot of variations.

    But, as you say, having a separate field for the code would certainly make things easier.

  5. #5
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    Another way to go is to check if a word is all caps and contains at least 4 or more characters. Those are likely candidates for a coupon code. Probably need to use this in conjunction with Butts' idea though.

    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  6. #6
    Visual Artist & ABW Ambassador lostdeviant's Avatar
    Join Date
    September 7th, 2007
    Location
    Cuautitlán, Edo. de México
    Posts
    1,725
    strpos to determine where to start if it isn't false and substr to get whatever follows which should contain the code, right?

    Is explode using space a good way to separate the code from whatever follows it?

  7. #7
    Newbie
    Join Date
    June 17th, 2009
    Posts
    2
    Help
    I am also looking for the solution for the same. Is there any other suggestion anyone of you would like to give?

  8. #8
    Newbie
    Join Date
    June 17th, 2009
    Posts
    2
    Quote Originally Posted by SeymourButts
    Each time the script runs and finds a string that I do not have, I then identify that in the script and then go back and modify the script to add the new string in. At this point, I have about 30 else statements looking for various forms of "coupon code", "promo code", "w/code", "use code", "with code". There are a lot of variations.

    But, as you say, having a separate field for the code would certainly make things easier.
    Does it works in all cases?

  9. #9
    Newbie
    Join Date
    September 25th, 2009
    Posts
    10
    Quote Originally Posted by SeymourButts
    Each time the script runs and finds a string that I do not have, I then identify that in the script and then go back and modify the script to add the new string in. At this point, I have about 30 else statements looking for various forms of "coupon code", "promo code", "w/code", "use code", "with code". There are a lot of variations.

    But, as you say, having a separate field for the code would certainly make things easier.
    Hi Seymour,

    I am extracting CouponCode using different technique almost same what you specified. Can you provide me all the combination you are using.

    Second MOST IMPORTANT, Can you please let me know how you are cleaning the description of Products to display as Title of Coupons.

    Because normally Description have everything written, I just wanted to display 20% off on all order how it is displayed at CouponCabin. Its very hard for me to make a logic which runs for every product description and make it more readable and attractive. Can you please guide me what to do.

    Please help.

  10. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. New Coupon Codes for Deal-Cool!
    By Webgains USA in forum Webgains.com
    Replies: 0
    Last Post: March 22nd, 2011, 11:52 AM
  2. ATTENTION! Calling all Daily Deal/Deal of the Day/Coupon/Savings/Gift/Jewelry Sites!!
    By Kim Salvino in forum Promotions, Sales, and Coupons on Affiliate Window
    Replies: 0
    Last Post: May 25th, 2010, 03:33 PM
  3. Replies: 0
    Last Post: May 25th, 2010, 03:33 PM
  4. Extract Value from Description field
    By Couponhutt in forum Couponer's Corner
    Replies: 0
    Last Post: October 22nd, 2009, 11:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •