Bitcoin Forum
December 07, 2016, 10:22:22 PM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Extention to augment Amazon links with my Affiliate Tag  (Read 3267 times)
moocow1452
Sr. Member
****
Offline Offline

Activity: 240

Don't mind me.


View Profile
March 30, 2012, 09:50:27 PM
 #1

I have an Amazon Affiliate link that's sitting around, doing not much of anything, so would it be kosher by Amazon's TOS to have a chrome extension, greasemonkey script or what have you that auto-magically diverts all Amazon outbound links through my affiliate address, and how would I pull that off in Javascript?

http://www.amazon.com/dp/product/[Product ID]/?tag=[Affiliate Tag]

I'm thinking it should be easy to do a look replace, but can someone do some hand holding and point me in the right direction? My java-fu is weak.
1481149342
Hero Member
*
Offline Offline

Posts: 1481149342

View Profile Personal Message (Offline)

Ignore
1481149342
Reply with quote  #2

1481149342
Report to moderator
1481149342
Hero Member
*
Offline Offline

Posts: 1481149342

View Profile Personal Message (Offline)

Ignore
1481149342
Reply with quote  #2

1481149342
Report to moderator
1481149342
Hero Member
*
Offline Offline

Posts: 1481149342

View Profile Personal Message (Offline)

Ignore
1481149342
Reply with quote  #2

1481149342
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481149342
Hero Member
*
Offline Offline

Posts: 1481149342

View Profile Personal Message (Offline)

Ignore
1481149342
Reply with quote  #2

1481149342
Report to moderator
1481149342
Hero Member
*
Offline Offline

Posts: 1481149342

View Profile Personal Message (Offline)

Ignore
1481149342
Reply with quote  #2

1481149342
Report to moderator
1481149342
Hero Member
*
Offline Offline

Posts: 1481149342

View Profile Personal Message (Offline)

Ignore
1481149342
Reply with quote  #2

1481149342
Report to moderator
nathanghart
Full Member
***
Offline Offline

Activity: 140



View Profile
March 30, 2012, 10:24:32 PM
 #2

I have an Amazon Affiliate link that's sitting around, doing not much of anything, so would it be kosher by Amazon's TOS to have a chrome extension, greasemonkey script or what have you that auto-magically diverts all Amazon outbound links through my affiliate address, and how would I pull that off in Javascript?

http://www.amazon.com/dp/product/[Product ID]/?tag=[Affiliate Tag]

I'm thinking it should be easy to do a look replace, but can someone do some hand holding and point me in the right direction? My java-fu is weak.

what about something like this
This is your chrome extension manifest
Code:
{
  "name": "Amazon Auto Affiliate",
  "version": "1.0",
  "description": "Adds an extension to change all amazon links to amazon links with your affiliate info.",
  "content_scripts": [
    {
      "css": ["mystyles.css"],
      "js": ["jquery.js", "myscript.js"],
 "run_at" : "document_end"
    }
  ]
}

Code:
// myscript.js

var affiliateCode = 'myafflicatecode'

onload = function () {
        for (var i = 0; i < document.links.length; i++)
     if (document.links[i].href.contains("amazon.com")) {
document.links[i].href = document.links[i].href +'?tag=' + affiliateCode
}
}

This should get you started with the basic framework....good luck.

Not mining since 6-26-2012
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!