Results 1 to 4 of 4

Thread: Parse Amazon LInk into Affiliate LInk

  1. #1
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055

    Parse Amazon LInk into Affiliate LInk

    Feedburner has a feature where any amazon link in your feed is automatically turned into an affiliate link.

    Has anyone seen php source code for doing this anywhere? I don't want to have to do it from scratch if I don't have it. I imagine you just need to parse out the ASIN from the link and put it into an affiliate link.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  2. #2
    Gimme Fries with that!
    Join Date
    Aug 2004
    Posts
    1,469
    str_replace I imagine would do the trick nicely since the asin is always in the same position.

  3. #3
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    Not always, Amazon has changed their URL structure a lot.

    I went with this:

    Code:
    $url_array = explode("/",$url);
    
    foreach ($url_array as $v) {
       if(ereg("^[A-Z0-9]*$", $v)){
    	   $url = "http://www.amazon.com/exec/obidos/ASIN/".$v."/ref=nosim/everythingshak06";
       }
    	
    }
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  4. #4
    Gimme Fries with that!
    Join Date
    Aug 2004
    Posts
    1,469
    exactly what i was thinking.

Similar Threads

  1. generic amazon link
    By pierrebenoit in forum Website Programming & Databases
    Replies: 3
    Last Post: 02-18-2005, 11:15 AM
  2. Can you build a refferal link to Amazon's affiliate program?
    By Sootah in forum Advertising & Affiliate Programs
    Replies: 1
    Last Post: 11-10-2004, 12:16 AM
  3. SE Friendly Amazon Affiliate Site.
    By Shawn in forum User Owned Websites
    Replies: 12
    Last Post: 02-05-2004, 10:22 AM
  4. Amazon affiliate question
    By Westech in forum Advertising & Affiliate Programs
    Replies: 7
    Last Post: 12-08-2003, 02:03 PM
  5. Amazon affiliate program
    By emke in forum Advertising & Affiliate Programs
    Replies: 11
    Last Post: 08-14-2003, 06:52 AM

Bookmarks

Posting Permissions

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