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!

NEW OPTION!
Works on mobile or desktop
Telegram Bot | Website


---

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.
« Last edited by Yo ssi on February 23, 2021, 07:57:42 PM »

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

Offline stooges44

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

gotch ya!

Correct, I'm just the messenger  ;D
If it's not free shipping it's not worth it.

Online etech0

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: Dec 2013
  • Posts: 12861
  • Total likes: 3316
  • 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: 1437
  • Total likes: 29
  • DansDeals.com Hat Tips 2
    • View Profile
  • Location: NY-Israel
Having a hard time creating a bookmark on my android. Can someone help?

Online jj1000

  • Administrator
  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • **********
  • Join Date: Jun 2008
  • Posts: 13470
  • Total likes: 6095
  • DansDeals.com Hat Tips 29367
    • 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)

Offline hide4

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

Online etech0

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: Dec 2013
  • Posts: 12861
  • Total likes: 3316
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
Aha. Is there a way to make the link on an android?
I don't have an android, but you can try the instructions in this link and see if they work.
https://www.labnol.org/software/google-chrome-bookmarklets/27894/
Workflowy. You won't know what you're missing until you try it.

Offline srap

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Dec 2013
  • Posts: 2819
  • Total likes: 202
  • DansDeals.com Hat Tips 4
    • View Profile
The whole purpose of this thread and @etech0's work of art is to make it easy for members to give hakaras hatov/show appreciation to Dan for all he does for us.  Therefore, we need to make it as user friendly as possibly IMO.  The excellent wiki spells out in detail what to do, but still makes assumptions.



[ Edit ] - Topic Wiki     Here is a bookmarklet [maybe a write short definition of what is a bookmarklet elsewhere], that will make a DD link from any amazon item page, and format it with the title so you can paste it into a DDF post.
          I would show an example of finished product here (picture and title).

Here's the code:    "(Copy and paste the highlighted section below)" [and then @etech0 should highlight the code in the wiki]
Code: 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",""+document.title+"\n\n");
    void(0);
 })()
As a reminder, to create a bookmarklet, right click on your bookmarks bar [explain where to find this] 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 posted highlighted above.

It might need a little tweaking, so let me know if you have a link that it doesn't work on.

Online ExGingi

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: Nov 2015
  • Posts: 15618
  • Total likes: 7712
  • DansDeals.com Hat Tips 19
    • View Profile
  • Location: 770
  • Programs: בשורת הגאולה. From Exile to Redemption. GIYF. AAdvantage Executive PlatinumŽ
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.
BUMP
I've been waiting over 5 years with bated breath for someone to say that!
-- Dan

Online etech0

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

Offline srap

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Dec 2013
  • Posts: 2819
  • Total likes: 202
  • DansDeals.com Hat Tips 4
    • View Profile
@srap wiki updated
You did an AMAZING job.  Thank you for the spoon feeding.

My Firefox has the word 'Add' so the wiki should read:           4. Click Save/Add
Also, the link I copied from the Amazon URL turns into the same code, not the product title.
« Last Edit: June 07, 2017, 12:27:35 AM by srap »

Online etech0

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: Dec 2013
  • Posts: 12861
  • Total likes: 3316
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
I don't have an android, but you can try the instructions in this link and see if they work.
https://www.labnol.org/software/google-chrome-bookmarklets/27894/
@hide4 did this work? If yes, let me know and I will add smartphone instructions to the wiki.

Or if anyone else who has a smartphone wants to try this, let me know how it goes.
Workflowy. You won't know what you're missing until you try it.

Online etech0

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: Dec 2013
  • Posts: 12861
  • Total likes: 3316
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
You did an AMAZING job.  Thank you for the spoon feeding.

My Firefox has the word 'Add' so the wiki should read:           4. Click Save/Add
Also, the URL displays the link, not the product title.
1. Thanks
2. Done
3. What do you mean by that?
Workflowy. You won't know what you're missing until you try it.

Offline srap

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Dec 2013
  • Posts: 2819
  • Total likes: 202
  • DansDeals.com Hat Tips 4
    • View Profile
1. Thanks
2. Done
3. What do you mean by that?
I'll fix the wording.
The code I copied from the Amazon URL and pasted in a post for ddf contained the same code letters/numbers, not the title of the Amazon page.

Offline hide4

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Oct 2015
  • Posts: 1437
  • Total likes: 29
  • DansDeals.com Hat Tips 2
    • View Profile
  • Location: NY-Israel
@hide4 did this work? If yes, let me know and I will add smartphone instructions to the wiki.

Or if anyone else who has a smartphone wants to try this, let me know how it goes.
Didn't figure it out. But didn't work too hard on it. I'll try again...

Online etech0

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: Dec 2013
  • Posts: 12861
  • Total likes: 3316
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
I'll fix the wording.
The code I copied from the Amazon URL and pasted in a post for ddf contained the same code letters/numbers, not the title of the Amazon page.
Can you post what you got?
Workflowy. You won't know what you're missing until you try it.

Offline yitzf

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Mar 2011
  • Posts: 2623
  • Total likes: 52
  • DansDeals.com Hat Tips 4
    • View Profile
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #55 on: June 07, 2017, 09:36:56 AM »
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.
It seems from https://affiliate-program.amazon.com/help/node/topic/202049200 than smile donations do not affect affiliate commission.

Online etech0

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: Dec 2013
  • Posts: 12861
  • Total likes: 3316
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
Wiki updated to a new version which will pull in the price as well.
Workflowy. You won't know what you're missing until you try it.

Offline stooges44

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Jan 2017
  • Posts: 6454
  • Total likes: 2746
  • DansDeals.com Hat Tips 269
    • View Profile
Wiki updated to a new version which will pull in the price as well.

Even cooler! thanks
If it's not free shipping it's not worth it.

Offline myi

  • Dansdeals Lifetime 20K Presidential Platinum Elite
  • ********
  • Join Date: Feb 2015
  • Posts: 23540
  • Total likes: 2427
  • DansDeals.com Hat Tips 356
  • Gender: Male
    • View Profile
  • Location: InMyPants! 🙈
  • Programs: 2Many2List!
Wiki updated to a new version which will pull in the price as well.
That's amazing.. great work can't wait to try.

Ps, waiting when it's going to start a new post on the forums in the amazon board and separate the price and title and the link in the post. Lol

 
Quote
Need your LG Exalt fixed? Cracked in half? Water damage? Or parts to repair yourself. 347.201.2501

Offline JoeyShmoe

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Nov 2014
  • Posts: 1276
  • Total likes: 254
  • DansDeals.com Hat Tips 0
  • Gender: Male
    • View Profile
  • Location: Lakewood
@etech0 I'd like to suggest 2 changes, 1) remove https:\/\/www. from the RegExp, this way it works if you have your Amazon auto redirect to smile.amazon.com like I do, and 2) remove all the repetetive var and semicolons from the variables and instead have them comma delimited, much cleaner and more correct :)

See my edits to your awesome code below:
Code: [Select]
javascript:(function(){
  var pattern = new RegExp("(amazon.com\/).*([dg]p\/)(?:product\/)?(..........).*", "i"),
      match = location.href.match(pattern),
      image = document.getElementById('landingImage').src,
      price = document.getElementById('priceblock_ourprice').innerHTML,
      URL = match[1] + "dp/" + match[3] +"/?tag=cl03f-20&smid=ATVPDKIKX0DER",
      result = "[url="+URL+"]"+document.title+" [b]("+price+")[/b][/url]\n\n[url="+URL+"][img]"+image+"[/img][/url]"; window.prompt("Press control-c",result); void(0);
})()
DDF A-Z Link Extension
Chrome
Firefox
Info