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 9627 times)

Online stooges44

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Jan 2017
  • Posts: 3411
  • Total likes: 175
  • DansDeals.com Hat Tips 154
    • View Profile
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);
 })()

FYI, this seems to not show the link on tapa: http://forums.dansdeals.com/index.php?topic=79426.msg1742611#msg1742611

Online etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 8601
  • Total likes: 138
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
FYI, this seems to not show the link on tapa: http://forums.dansdeals.com/index.php?topic=79426.msg1742611#msg1742611
What about the one that shows the item title, does that one work?
Workflowy. You won't know what you're missing until you try it.

Online etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 8601
  • Total likes: 138
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
I'm still not sure why the above bookmarklet doesn't work in tapatalk, but here it is with one tweak. Can anyone tell me if this one does work in tapa? @stooges44 (or anyone else)?

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+"[/url]\n\n[url="+URL+"][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: 9069
  • Total likes: 388
  • DansDeals.com Hat Tips 151
    • View Profile
  • Location: brklyn/Israel
I'm still not sure why the above bookmarklet doesn't work in tapatalk, but here it is with one tweak. Can anyone tell me if this one does work in tapa? @stooges44 (or anyone else)?

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+"[/url]\n\n[url="+URL+"][img]"+image+"[/img][/url]"); void(0); })()
@etech0 you should make a link available for them to try to click on.;)
Don't try to be someone else , be who you are because everyone else is taken.

Online etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 8601
  • Total likes: 138
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
@etech0 you should make a link available for them to try to click on.;)
If this one works then there's no need... it's nicer to see the title of the item than the url, no?
Workflowy. You won't know what you're missing until you try it.

Online ExGingi

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Nov 2015
  • Posts: 3024
  • Total likes: 210
  • DansDeals.com Hat Tips 5
    • View Profile
  • Location: 770
I've don't recall ever receiving an answer as to whether @Dan gets commissions also on smile.amazon.com. If yes, the script needs to be updated to allow for a smile.amazon.com link. If not, it should parse the smile.amazon.com link and replace it appropriately.

Online stooges44

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Jan 2017
  • Posts: 3411
  • Total likes: 175
  • DansDeals.com Hat Tips 154
    • View Profile
I'm still not sure why the above bookmarklet doesn't work in tapatalk, but here it is with one tweak. Can anyone tell me if this one does work in tapa? @stooges44 (or anyone else)?

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+"[/url]\n\n[url="+URL+"][img]"+image+"[/img][/url]"); void(0); })()

I don't use tapa so I wouldn't know.

Offline myi

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Feb 2015
  • Posts: 9069
  • Total likes: 388
  • DansDeals.com Hat Tips 151
    • View Profile
  • Location: brklyn/Israel
Don't try to be someone else , be who you are because everyone else is taken.

Online etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 8601
  • Total likes: 138
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
So what's that all about?
@stooges44 posts links and then people complain that they can't click them
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: 9069
  • Total likes: 388
  • DansDeals.com Hat Tips 151
    • View Profile
  • Location: brklyn/Israel
@stooges44 posts links and then people complain that they can't click them
gotch ya!
Don't try to be someone else , be who you are because everyone else is taken.

Online stooges44

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Jan 2017
  • Posts: 3411
  • Total likes: 175
  • DansDeals.com Hat Tips 154
    • View Profile
@stooges44 posts links and then people complain that they can't click them

gotch ya!

Correct, I'm just the messenger  ;D

Online etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 8601
  • Total likes: 138
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
Correct, I'm just the messenger  ;D
Don't shoot the messenger, as they say!
Workflowy. You won't know what you're missing until you try it.

Offline hide4

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Oct 2015
  • Posts: 1033
  • Total likes: 15
  • DansDeals.com Hat Tips 0
    • View Profile
  • Location: NY-Israel
Having a hard time creating a bookmark on my android. Can someone help?

Online jj1000

  • Administrator
  • Dansdeals Lifetime Presidential Platinum Elite
  • **********
  • Join Date: Jun 2008
  • Posts: 9328
  • Total likes: 314
  • DansDeals.com Hat Tips 6230
    • View Profile
  • Location: The value of a forum such as this one is not in that one can post a question and receive an answer, but in that the question has most likely been asked before, and the answer is available to him that will but only use the search function.
  • Programs: 1. Search on google. 2. Search in the right board of DDF with a general word or two. 3. Read the wiki. 4. Read the thread. 5. Ask away.
Having a hard time creating a bookmark on my android. Can someone help?
This is for desktop
See my 5 step program to your left <--

(Real signature under my location)

Give More Likes, It's Free!

Offline hide4

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Oct 2015
  • Posts: 1033
  • Total likes: 15
  • DansDeals.com Hat Tips 0
    • View Profile
  • Location: NY-Israel
This is for desktop
Aha. Is there a way to make the link on an android?