Amazonの商品ページから自分のアフィリエイトリンク作成/移動

毛利です。

Amazon の商品ページ見てて、自分のアフィリエイトリンクを作りたい、もしくは移動したいという時に。
とりあえず自分が使えればいい、というレベルなのでコードとしては綺麗ではありません。あしからず。
(linkCode などのパラメータの意味を知らずに、適当に貼りつけてます)


bookmarklet 自体の作成方法はこちらへ。

bookmarklet - Google 検索

※分かりやすいページがなかったので。。


アフィリエイトリンクを作成


商品ページ表示中に、自分のアフィリエイトリンクを作成したい場合。
ポップアップするので、Ctrl+C などでコピーしてください。

注意:この bookmarklet は私自身のアフィリエイトIDが組み込まれています。「var id="techniqforeas-22"」の techniqforeas-22 の部分を修正してください。

▼2012/06/27 修正版

javascript:(function(){var id="techniqforeas-22";var a=location.href.split('/');var cl=(a[3]=="exec"?6:5);var asin=a[cl];prompt(id,"http://www.amazon.co.jp/gp/product/"+asin+"/"+id+"/");})()

javascript:(function(){var id="techniqforeas-22";var a=location.href.split('/');var cl=(a[3]=="exec"?6:5);var asin=a[cl];prompt(id,"http://www.amazon.co.jp/gp/product/"+asin+"/ref=as_li_ss_tl?ie=UTF8&tag="+id+"&linkCode=as2&camp=247&creative=7399&creativeASIN="+asin);})()


見やすくするとこう。

▼2012/06/27 修正版

javascript : (function ()
{
var id = "techniqforeas-22";
var a = location.href.split('/');
var cl = (a[3] == "exec" ? 6 : 5);
var asin = a[cl];
prompt(id, "http://www.amazon.co.jp/gp/product/" + asin + "/" + id + "/");
})()

javascript : (function ()
{
var id = "techniqforeas-22";
var a = location.href.split('/');
var cl = (a[3] == "exec" ? 6 : 5);
var asin = a[cl];
location.href = "http://www.amazon.co.jp/gp/product/" + asin + "/ref=as_li_ss_tl?ie=UTF8&tag=" + id + "&linkCode=as2&camp=247&creative=7399&creativeASIN=" + asin);
})()


powered by JavaScriptのコード整形&色付け(貼り付け用)

アフィリエイトリンクへ移動

商品ページ表示中に、自分のアフィリエイトリンクに移動したくなった場合。
実行するとページ移動が発生します。

注意:この bookmarklet は私自身のアフィリエイトIDが組み込まれています。「var id="techniqforeas-22"」の techniqforeas-22 の部分を修正してください。


▼2012/06/27 修正版

javascript:(function(){var id="techniqforeas-22";var a=location.href.split('/');var cl=(a[3]=="exec"?6:5);var asin=a[cl];location.href="http://www.amazon.co.jp/exec/obidos/ASIN/"+asin+"/"+id+"/"})()

javascript:(function(){var id="techniqforeas-22";var a=location.href.split('/');var cl=(a[3]=="exec"?6:5);var asin=a[cl];location.href="http://www.amazon.co.jp/gp/product/"+asin+"/ref=as_li_ss_tl?ie=UTF8&tag="+id+"&linkCode=as2&camp=247&creative=7399&creativeASIN="+asin})()


見やすくするとこう。


▼2012/06/27 修正版

javascript : (function ()
{
var id = "techniqforeas-22";
var a = location.href.split('/');
var cl = (a[3] == "exec" ? 6 : 5);
var asin = a[cl];
location.href = "http://www.amazon.co.jp/exec/obidos/ASIN/" + asin + "/" + id + "/";
})()


javascript : (function ()
{
var id = "techniqforeas-22";
var a = location.href.split('/');
var cl = (a[3] == "exec" ? 6 : 5);
var asin = a[cl];
location.href = "http://www.amazon.co.jp/gp/product/" + asin + "/ref=as_li_ss_tl?ie=UTF8&tag=" + id + "&linkCode=as2&camp=247&creative=7399&creativeASIN=" + asin;
})()


powered by JavaScriptのコード整形&色付け(貼り付け用)