Topic Wiki

UPDATE:
@JoeyShmoe did a great job creating a Chrome Extension and a Firefox Extension to save us all the hassle of setting up a bookmarklet. The extension will place a button on any Amazon product page. When you click the button it will copy a link to your clipboard, which you can paste into any DDF post. The post will then contain the product title, image, and a working link to the product.

Thanks @JoeyShmoe!

---

For anyone who doesn't want to install a browser extension, read below how to set up the bookmarklet:

Here is a bookmarklet that will make a DD link from any amazon item page, and format it with the title and an image so you can paste it into a DDF post.

Example:

Little Tikes Rocking Horse Magenta ($34.07)



(Not sure what a bookmarklet is? Read more about them in this thread: http://forums.dansdeals.com/index.php?topic=61269.5.)

Here's how to install the bookmarklet:

1. If you don't currently see a row of bookmarks on the top of your browser, you will need to show the bookmarks bar.
- In Chrome, click the 3 vertical dots at the top right of your screen, click Settings, and click Always Show the Bookmarks Bar.
- In Firefox, click the 3 horizontal lines at the top right of your screen, and click Customize. Then click Show/Hide Toolbars (bottom left of your screen) and check off the Bookmarks Toolbar.

2. Copy the following code. (To do so, click the SELECT button and then press control-c on your keyboard.)
Code: [Select]
javascript: (function() {
    var pattern = new RegExp("(https:\/\/www.amazon.com\/).*([dg]p\/)(?:product\/)?(..........).*|(https:\/\/smile.amazon.com\/).*([dg]p\/)(?:product\/)?(..........).*", "i"),
        match = location.href.match(pattern),
        image = document.getElementById('landingImage').src;
    var price = "";
    if (document.getElementById('priceblock_dealprice') !== null) {
        price = " (" + document.getElementById('priceblock_dealprice').innerHTML + ")";
    } else if (document.getElementById('priceblock_ourprice') !== null) {
        price = " (" + document.getElementById('priceblock_ourprice').innerHTML + ")";
    }
    var URL = (match[1] !== undefined) ? match[1] + "dp/" + match[3] + "/?tag=cl03f-20&smid=ATVPDKIKX0DER" : match[4] + "dp/" + match[6] + "/?tag=cl03f-20&smid=ATVPDKIKX0DER";
    var result = "[url=" + URL + "]" + document.title + price + "[/url][br][br][url=" + URL + "][img]" + image + "[/img][/url]";
    if (document.execCommand('copy') !== false) {
        var ddLink = document.createElement('span'),
            range = document.createRange();
        ddLink.id = "ddLink";
        ddLink.innerText = result;
        document.body.appendChild(ddLink);
        range.selectNode(document.getElementById('ddLink'));
        window.getSelection().addRange(range);
        document.execCommand('copy');
        document.getElementById('ddLink').remove();
        setTimeout(function() {
            alert('DD link copied to clipboard...')
        }, 1000);
    } else {
        window.prompt("Press control-c", result);
    }
    void(0);
})()

3. To create the bookmarklet, right click on your bookmarks bar and click "Add page" (if you're in Chrome) or "New bookmark" (Firefox).

For the Name, enter whatever you want (eg: Dan Amazon link), and for the URL/Location enter the code above, which you already copied.

4. Click Save (Chrome) or Add (Firefox)

To use the bookmarklet, simply click on the bookmark you created (in step 3) when you are on any amazon product page. Follow the prompts (you may need to press control-c to copy what pops up), and then paste it into any DDF post.

Enjoy!

Disclaimer: The code might need a little tweaking, so let me know if you have a link that it doesn't work on. If there are any changes I will update the wiki.

Author Topic: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon  (Read 7286 times)

Offline etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 8472
  • Total likes: 116
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
Any way to add that feature to yours where you would be able to pull the picture of the product to your link and post it for you as well, if yes that would be truly an amazing piece of artwork, not that this is not one.
 @etech0
Not that I know of offhand, but I'll keep it in mind.
Workflowy. You won't know what you're missing until you try it.

Offline CreamofSoup

  • Dansdeals Gold Elite
  • ***
  • Join Date: May 2016
  • Posts: 212
  • Total likes: 11
  • DansDeals.com Hat Tips 0
    • View Profile
  • Location: Baltimore
@etech0, if I want it to force amazon smile as well as the DD details I just change the "www." to "smile.", right?

Offline myi

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Feb 2015
  • Posts: 8327
  • Total likes: 271
  • DansDeals.com Hat Tips 126
    • View Profile
  • Location: brklyn/Israel
@etech0, if I want it to force amazon smile as well as the DD details I just change the "www." to "smile.", right?
Try that and see what happens.
Don't try to be someone else , be who you are because everyone else is taken.

Offline CreamofSoup

  • Dansdeals Gold Elite
  • ***
  • Join Date: May 2016
  • Posts: 212
  • Total likes: 11
  • DansDeals.com Hat Tips 0
    • View Profile
  • Location: Baltimore
Try that and see what happens.

Good call. It does!

Offline stooges44

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Jan 2017
  • Posts: 3027
  • Total likes: 112
  • DansDeals.com Hat Tips 110
    • View Profile
There's not much more to be addicted to, then what you are. Lol ;) (you've reached the max! :)

+1 it's unprecedented!

David, you slept for less then 5 hours?


Offline etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 8472
  • Total likes: 116
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
@etech0, if I want it to force amazon smile as well as the DD details I just change the "www." to "smile.", right?
Someone can CMIIW, but I think you can't combine smile with the DD link.
Workflowy. You won't know what you're missing until you try it.

Offline CreamofSoup

  • Dansdeals Gold Elite
  • ***
  • Join Date: May 2016
  • Posts: 212
  • Total likes: 11
  • DansDeals.com Hat Tips 0
    • View Profile
  • Location: Baltimore
Someone can CMIIW, but I think you can't combine smile with the DD link.

As in if I go through smile you think Dan doesn't get his click?

Offline stooges44

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Jan 2017
  • Posts: 3027
  • Total likes: 112
  • DansDeals.com Hat Tips 110
    • View Profile
As in if I go through smile you think Dan doesn't get his click?

Would make sense, why would they give to both the charity and dan?

Offline etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 8472
  • Total likes: 116
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
As in if I go through smile you think Dan doesn't get his click?
That's what I think
Would make sense, why would they give to both the charity and dan?
But we can ask @Dan to confirm
Workflowy. You won't know what you're missing until you try it.

Offline CreamofSoup

  • Dansdeals Gold Elite
  • ***
  • Join Date: May 2016
  • Posts: 212
  • Total likes: 11
  • DansDeals.com Hat Tips 0
    • View Profile
  • Location: Baltimore
Would make sense, why would they give to both the charity and dan?

Dan would be considered an associate, right? If so, this link doesn't address this exact situation but seems to imply that both parties would be paid.

https://affiliate-program.amazon.com/help/node/topic/202049200

Offline etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 8472
  • Total likes: 116
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
Here's an updated version that should pull in the image too

Code: [Select]
javascript:(function(){
var pattern = new RegExp("(https:\/\/www.amazon.com\/).*([dg]p\/)(?:product\/)?(..........).*", "i");
  var match = location.href.match(pattern);
var image =  document.getElementById('landingImage').src;
var URL = match[1] + "dp/" + match[3] +"/?tag=cl03f-20&smid=ATVPDKIKX0DER";
window.prompt("Press control-c","[url="+URL+"]"+document.title+"\n\n[img]"+image+"[/img][/url]");
void(0);
 })()
Workflowy. You won't know what you're missing until you try it.

Offline myi

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Feb 2015
  • Posts: 8327
  • Total likes: 271
  • DansDeals.com Hat Tips 126
    • View Profile
  • Location: brklyn/Israel
Here's an updated version that should pull in the image too

Code: [Select]
javascript:(function(){
var pattern = new RegExp("(https:\/\/www.amazon.com\/).*([dg]p\/)(?:product\/)?(..........).*", "i");
  var match = location.href.match(pattern);
var image =  document.getElementById('landingImage').src;
var URL = match[1] + "dp/" + match[3] +"/?tag=cl03f-20&smid=ATVPDKIKX0DER";
window.prompt("Press control-c","[url="+URL+"]"+document.title+"\n\n[img]"+image+"[/img][/url]");
void(0);
 })()
Wow your amazing, will try this a bit later and confirm.
Don't try to be someone else , be who you are because everyone else is taken.

Offline User6669

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Mar 2015
  • Posts: 2753
  • Total likes: 81
  • DansDeals.com Hat Tips 2
  • Gender: Male
    • View Profile
  .איזהו חכם, הלומד מכל אדם 

Offline etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 8472
  • Total likes: 116
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
Workflowy. You won't know what you're missing until you try it.

Offline etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 8472
  • Total likes: 116
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
wiki created
Workflowy. You won't know what you're missing until you try it.