PDA

View Full Version : convert ebay links to auctionads links


Slapyo
04-07-2007, 04:22 AM
I think it would be a great mod if we could have ebay links get converted to auctionads links.

<removed>

It would be fairly easy i think. I looked at the amazon code but couldn't figure out how to make it work with this.

Basically, you just url encode the ebay link and stick it on to the end of the auction ads link:
http://ads.auctionads.com/pagead/link_{accountcodehere}_{campaigncodehere}_http%3A//www.ebay.com/blah

Anyone wanna do this!?

I guess the problem would be having to weed out links to ebay images. That way those images would still show up, but any links to ebay pages would be converted when displayed in the posts.

I'm horrible with preg_match. But I would think that the code would do something similar to this.

Check for all instances of [ u r l=http://cgi.ebay.com/someitem]a link[/url] and change the url to the auctionads link.
Check for all instances of [ u r l]http://cgi.ebay.com/someitem[/url] and convert that into the following [ u r l=http://auctionadslink]original ebay link[/url]

None of this would be saved to the database, it would just be parsed out right before displaying.

Dismounted
04-07-2007, 06:26 AM
I might do this if I release my eBay affiliate link code.

Slapyo
04-07-2007, 07:06 AM
i have some code already with the regex but i ran into a problem. i have 3 patterns.
1 - matches [.url.]http://cgi.ebay.com/blah[./url.]
2 - matches [.url=http://cgi.ebay.com/blah]link[./url.]
3 - matches http://cgi.ebay.com/blah

but when it runs, the patterns match more than once and it screws up the link.

i never really got into regular expressions at all, this is all new to me.

that would be great if you could do this one. you can find out how auctionads writes its urls if you go to the site, make an account and go to the url converter page.

Dismounted
04-07-2007, 09:09 AM
I've released my eBay Affiliate code. I'll work out how these URL's work and make another hack for AuctionAds.

Slapyo
04-07-2007, 01:01 PM
Great! Thank you very much!

Dismounted
04-08-2007, 06:58 AM
Can you PM me a working auctionads link?

Thanks,
Dismounted

Dismounted
04-10-2007, 08:50 AM
<a href="https://vborg.vbsupport.ru/showthread.php?t=144468" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=144468</a>

Tigur
04-10-2007, 08:51 AM
Now that was fast.

Slapyo
04-10-2007, 03:43 PM
thanks dismounted