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

Online etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 9539
  • Total likes: 366
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
Extension was updated. Version 0.9.1 has an option to redirect to Amazon Smile. I also cleaned up some of the code, which included redirecting before the page loaded so you won't see a page load then reload just to add the tag or smile.amazon...
awesome! double thanks because that refresh thing was bothering me. Will go check it out now.
Workflowy. You won't know what you're missing until you try it.

Offline JoeyShmoe

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Nov 2014
  • Posts: 1157
  • Total likes: 80
  • DansDeals.com Hat Tips 0
  • Gender: Male
    • View Profile
  • Location: Lakewood
awesome! double thanks because that refresh thing was bothering me. Will go check it out now.
Was annoying me as well :)

Let me know if it works for you
DDF A-Z Link Extension
Chrome
Firefox
Info

Online etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 9539
  • Total likes: 366
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
I updated the extension on my end but I don't see it redirecting to smile
Workflowy. You won't know what you're missing until you try it.

Offline JoeyShmoe

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Nov 2014
  • Posts: 1157
  • Total likes: 80
  • DansDeals.com Hat Tips 0
  • Gender: Male
    • View Profile
  • Location: Lakewood
I updated the extension on my end but I don't see it redirecting to smile
It's an option, same as whether to add Dan's referral is a tag (right click the extension logo and click options)
DDF A-Z Link Extension
Chrome
Firefox
Info

Online etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 9539
  • Total likes: 366
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
It's an option, same as whether to add Dan's referral is a tag (right click the extension logo and click options)
Oh right :)

Works now! Thanks again!!
Workflowy. You won't know what you're missing until you try it.

Offline JoeyShmoe

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Nov 2014
  • Posts: 1157
  • Total likes: 80
  • DansDeals.com Hat Tips 0
  • Gender: Male
    • View Profile
  • Location: Lakewood
Oh right :)

Works now! Thanks again!!
My pleasure

While at it, I fixed this as well (problem was the full screen image as @etech0 mentioned) - will be live in version 0.9.2 it's live now in latest version (0.9.2)
Is it only me? or this one item doesn't work?

https://www.amazon.com/dp/B000HDK0DC/?tag=cl03f-20&smid=ATVPDKIKX0DER&th=1
« Last Edit: July 17, 2019, 02:14:34 PM by JoeyShmoe »
DDF A-Z Link Extension
Chrome
Firefox
Info

Offline myi

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: Feb 2015
  • Posts: 17328
  • Total likes: 1061
  • DansDeals.com Hat Tips 292
  • Gender: Male
    • View Profile
  • Location: InMyPants! 🙈
  • Programs: 2Many2List!
I see you extension but doesn't pop up on Prime Now products. It says clip to copy DDF>>>>

Don't try to be someone else , be who you are because everyone else is taken.

Offline JoeyShmoe

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Nov 2014
  • Posts: 1157
  • Total likes: 80
  • DansDeals.com Hat Tips 0
  • Gender: Male
    • View Profile
  • Location: Lakewood
I see you extension but doesn't pop up on Prime Now products. It says clip to copy DDF>>>>


Link please
DDF A-Z Link Extension
Chrome
Firefox
Info

Offline myi

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: Feb 2015
  • Posts: 17328
  • Total likes: 1061
  • DansDeals.com Hat Tips 292
  • Gender: Male
    • View Profile
  • Location: InMyPants! 🙈
  • Programs: 2Many2List!
Link please
It's a prime now product, but the funny part is that the text appears but no link.

https://primenow.amazon.com/dp/B07BZPGHYR?
Don't try to be someone else , be who you are because everyone else is taken.

Offline JoeyShmoe

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Nov 2014
  • Posts: 1157
  • Total likes: 80
  • DansDeals.com Hat Tips 0
  • Gender: Male
    • View Profile
  • Location: Lakewood
It's a prime now product, but the funny part is that the text appears but no link.

https://primenow.amazon.com/dp/B07BZPGHYR?
The button comes up that way because they manually changed the style for buttons. You can still click on the link...

... although, this has a totally different page style, so something is broken and errors when you click on the link  >:(
DDF A-Z Link Extension
Chrome
Firefox
Info

Offline myi

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: Feb 2015
  • Posts: 17328
  • Total likes: 1061
  • DansDeals.com Hat Tips 292
  • Gender: Male
    • View Profile
  • Location: InMyPants! 🙈
  • Programs: 2Many2List!
The button comes up that way because they manually changed the style for buttons. You can still click on the link...

... although, this has a totally different page style, so something is broken and errors when you click on the link  >:(
Is it because it's a prime now product! Or shouldnt make a difference?
Don't try to be someone else , be who you are because everyone else is taken.

Offline JoeyShmoe

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Nov 2014
  • Posts: 1157
  • Total likes: 80
  • DansDeals.com Hat Tips 0
  • Gender: Male
    • View Profile
  • Location: Lakewood
Is it because it's a prime now product! Or shouldnt make a difference?
Looks like they use a total different styling for Prime Now. I'll dig into it when I get a chance. Shouldn't be too hard to crack
DDF A-Z Link Extension
Chrome
Firefox
Info