Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Embedding ebay affiliate code
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Embedding ebay affiliate code

 Post Reply Post Reply Page  12>
Author
kbannon View Drop Down
Groupie
Groupie


Joined: 03 October 2002
Location: Ireland
Status: Offline
Points: 115
Post Options Post Options   Thanks (0) Thanks(0)   Quote kbannon Quote  Post ReplyReply Direct Link To This Post Topic: Embedding ebay affiliate code
    Posted: 25 April 2007 at 11:59am
I am hoping that this is possible but with the vast array of ebay URLs it may prove difficult.
I have been asked about the possibility of changing any ebay links submitted to concatenate an affiliate URL onto the front so that instead of http://cgi.ebay.co.uk/ws/eBayISAPI.dll?...
it would be
http://affiliate.ebay.com/...&mpre=http://cgi.ebay.co.uk/ws/eBayISAPI.dll?...

Is this possible within the current system? Is it a case of just adding a new filter? How would you trap the entire URL - using spaces?
It would have to be done for the various ebay TLDs (.com, .co.uk, .ie, .de...) also.
Thanks
I don't suffer from insanity, I enjoy every minute of it.
Back to Top
MortiOli View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 May 2002
Location: United Kingdom
Status: Offline
Points: 514
Post Options Post Options   Thanks (0) Thanks(0)   Quote MortiOli Quote  Post ReplyReply Direct Link To This Post Posted: 25 April 2007 at 12:26pm

Just out of interest, what does this gain by putting an affiliate code at the start?  Does ebay pay you money etc?

Back to Top
kbannon View Drop Down
Groupie
Groupie


Joined: 03 October 2002
Location: Ireland
Status: Offline
Points: 115
Post Options Post Options   Thanks (0) Thanks(0)   Quote kbannon Quote  Post ReplyReply Direct Link To This Post Posted: 25 April 2007 at 12:32pm
yup - they pay a percentage of the sales figure
I don't suffer from insanity, I enjoy every minute of it.
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 25 April 2007 at 8:44pm
it may be best to have a function to detect it in the forum_posts.asp page

as if you do it durin adding the post to the DB any time its edited it adds it again. or the user can just remove it?

i would look at the current functions for example the Flash one?

change it from looking for "[FLASH" to "<a href=""http://cgi.ebay""

this might be quite easy to do
S2H.co.uk - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
kbannon View Drop Down
Groupie
Groupie


Joined: 03 October 2002
Location: Ireland
Status: Offline
Points: 115
Post Options Post Options   Thanks (0) Thanks(0)   Quote kbannon Quote  Post ReplyReply Direct Link To This Post Posted: 30 April 2007 at 11:07pm
I inserted a replace function to trap "http://cgi.ebay." and that works fine.
However, it seems that the original ebay link must be encoded and then appended onto the affiliate link.
How would I manage to encode that portion? I guess I need to find the next space after "http://cgi.ebay." presumably using some mix of Instr() but how would I cope with the dynamic lengths and repeated occurneces?

I don't suffer from insanity, I enjoy every minute of it.
Back to Top
kbannon View Drop Down
Groupie
Groupie


Joined: 03 October 2002
Location: Ireland
Status: Offline
Points: 115
Post Options Post Options   Thanks (0) Thanks(0)   Quote kbannon Quote  Post ReplyReply Direct Link To This Post Posted: 09 May 2007 at 8:01pm
Anyone?
Cry
I don't suffer from insanity, I enjoy every minute of it.
Back to Top
kbannon View Drop Down
Groupie
Groupie


Joined: 03 October 2002
Location: Ireland
Status: Offline
Points: 115
Post Options Post Options   Thanks (0) Thanks(0)   Quote kbannon Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 2007 at 10:14pm
I solved it in the end - I used a regular expression to pick out certain words in a string and then replace the matches with encoded versions of the same and then append the affiliate link onto the encoded URL (as per ebay  instructions).
<%
Function EncodeEbayHyperlinks(inText)
Dim objRegExp, strBuf, ebayAffiliateURL
Dim objMatches, objMatch
Dim Value, ReplaceValue, iStart, iEnd

  ebayAffiliateURL = "http://rover.ebay.com/rover/1/711-1751-2978-71/1?AID=5463217&PID=2399323&mpre="
  strBuf = ""
  iStart = 1
  iEnd = 1
  Set objRegExp = New RegExp

  objRegExp.Pattern = "\b(http\://stores.ebay\.|http\://www.ebay\.|http\://cgi\.ebay\.|stores.ebay\.|www.ebay\.|ebay\.|cgi\.ebay\.)\S+\b"
  objRegExp.IgnoreCase =   True                   ' Set case insensitivity.
  objRegExp.Global =   True                      ' Set global applicability.
  Set objMatches = objRegExp.Execute(inText)
  For Each objMatch in objMatches
    iEnd = objMatch.FirstIndex
    strBuf = strBuf & Mid(inText, iStart, iEnd-iStart+1)
      strBuf = strBuf & ebayAffiliateURL & Server.UrlEncode(objMatch.Value)
    iStart = iEnd+objMatch.Length+1
  Next
  strBuf = strBuf & Mid(inText, iStart)
  EncodeEbayHyperlinks = strBuf
  Set objRegExp = Nothing
End Function
%>


I then just replaced my strMessage (or whatever the variable the forum posts are) with
EncodeEbayHyperlinks(strMessage)

Edited by kbannon - 14 May 2007 at 10:15pm
I don't suffer from insanity, I enjoy every minute of it.
Back to Top
MortiOli View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 May 2002
Location: United Kingdom
Status: Offline
Points: 514
Post Options Post Options   Thanks (0) Thanks(0)   Quote MortiOli Quote  Post ReplyReply Direct Link To This Post Posted: 26 June 2007 at 9:10pm
kbannon, any chance you could release this as a mod, with full instructions on implementation?
 
If it makes me money, I'm up for implementing it :-)
 
I take it, it doesn't affect anything else?
 
Cheers!
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.