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

Offline Yo ssi

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Aug 2019
  • Posts: 5077
  • Total likes: 1804
  • DansDeals.com Hat Tips 53
  • Gender: Male
    • View Profile
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #440 on: December 07, 2021, 01:45:25 PM »
@Yo ssi @JoeyShmoe probably makes sense for both of you to open source your code, so future members could take it over from you if either of you go "on leave". And don't be embarrassed about ugly code - no one cares; this isn't meant to be enterprise grade software.
While my code might not be, the extension has pretty much all it's code available to the public.

I'm using a neat hack, which has a Google sheet (/ App script) running my code. The extension is definitely the right way to do it, scraping a site isn't ideal. It would be cool to have them both running similar code so any update will work for both.
_    ,
' )  /
 /  / __   _   _   o
(__/_(_)  /_)_/_)_<_
 //
(/

Offline Yo ssi

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Aug 2019
  • Posts: 5077
  • Total likes: 1804
  • DansDeals.com Hat Tips 53
  • Gender: Male
    • View Profile
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #441 on: December 07, 2021, 01:46:23 PM »
I was actually looking for the button the other day, and figured the extension was out of date. I don't use it super often, but would definitely like to have it back.
Tried the bot?

It's having some issues I don't have time to deal with.
_    ,
' )  /
 /  / __   _   _   o
(__/_(_)  /_)_/_)_<_
 //
(/

Offline JoeyShmoe

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Nov 2014
  • Posts: 1235
  • Total likes: 171
  • DansDeals.com Hat Tips 0
  • Gender: Male
    • View Profile
  • Location: Lakewood
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #442 on: December 07, 2021, 02:36:39 PM »
@Yo ssi @JoeyShmoe probably makes sense for both of you to open source your code, so future members could take it over from you if either of you go "on leave". And don't be embarrassed about ugly code - no one cares; this isn't meant to be enterprise grade software.
Open sourcing sounds like a great idea to me, as @Yo ssi mentioned, there's nothing too exciting about it.

I was actually looking for the button the other day, and figured the extension was out of date. I don't use it super often, but would definitely like to have it back.
Do you happen to remember where it failed? I can try to find the issue that way
DDF A-Z Link Extension
Chrome
Firefox
Info

Offline Yo ssi

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Aug 2019
  • Posts: 5077
  • Total likes: 1804
  • DansDeals.com Hat Tips 53
  • Gender: Male
    • View Profile
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #443 on: December 07, 2021, 02:45:59 PM »
Do you happen to remember where it failed? I can try to find the issue that way
As mentioned Amazon I believe changed the ID of the price, it should be a simple fix.
_    ,
' )  /
 /  / __   _   _   o
(__/_(_)  /_)_/_)_<_
 //
(/

Online YitzyS

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Jan 2015
  • Posts: 4585
  • Total likes: 10030
  • DansDeals.com Hat Tips 34
  • Gender: Male
    • View Profile
  • Location: Lakewood, NJ
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #444 on: December 08, 2021, 11:03:43 PM »
The website and bot don't work for me due to my filter, despite much effort on my part. I can only use the Chrome extension, and it's been a bummer that it hasn't been working much lately.

So yes, one loud, ringing vote for "Fix the Chrome extension."

Thank you.

Offline Yo ssi

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Aug 2019
  • Posts: 5077
  • Total likes: 1804
  • DansDeals.com Hat Tips 53
  • Gender: Male
    • View Profile
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #445 on: December 09, 2021, 01:23:30 AM »
The website and bot don't work for me due to my filter, despite much effort on my part. I can only use the Chrome extension, and it's been a bummer that it hasn't been working much lately.

So yes, one loud, ringing vote for "Fix the Chrome extension."

Thank you.
You know who to tag / mention :D
_    ,
' )  /
 /  / __   _   _   o
(__/_(_)  /_)_/_)_<_
 //
(/

Offline JoeyShmoe

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Nov 2014
  • Posts: 1235
  • Total likes: 171
  • DansDeals.com Hat Tips 0
  • Gender: Male
    • View Profile
  • Location: Lakewood
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #446 on: December 09, 2021, 10:27:46 AM »
The website and bot don't work for me due to my filter, despite much effort on my part. I can only use the Chrome extension, and it's been a bummer that it hasn't been working much lately.

So yes, one loud, ringing vote for "Fix the Chrome extension."

Thank you.
Will do! Stay tuned
DDF A-Z Link Extension
Chrome
Firefox
Info

Offline JoeyShmoe

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Nov 2014
  • Posts: 1235
  • Total likes: 171
  • DansDeals.com Hat Tips 0
  • Gender: Male
    • View Profile
  • Location: Lakewood
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #447 on: December 09, 2021, 11:50:20 AM »
I just pushed an update that should hopefully work for most cases (it worked on all cases that I tested), according to the Chrome Store it might take a couple of weeks for it to be approved, I'll keep y'all posted when it's published
DDF A-Z Link Extension
Chrome
Firefox
Info

Online YitzyS

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Jan 2015
  • Posts: 4585
  • Total likes: 10030
  • DansDeals.com Hat Tips 34
  • Gender: Male
    • View Profile
  • Location: Lakewood, NJ
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #448 on: December 09, 2021, 11:53:10 AM »
I just pushed an update that should hopefully work for most cases (it worked on all cases that I tested), according to the Chrome Store it might take a couple of weeks for it to be approved, I'll keep y'all posted when it's published
Thanks!!!! Will it automatically update, or do I have to do it manually?

Offline JoeyShmoe

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Nov 2014
  • Posts: 1235
  • Total likes: 171
  • DansDeals.com Hat Tips 0
  • Gender: Male
    • View Profile
  • Location: Lakewood
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #449 on: December 09, 2021, 11:55:28 AM »
Thanks!!!! Will it automatically update, or do I have to do it manually?
It should do it automatically
DDF A-Z Link Extension
Chrome
Firefox
Info

Online aygart

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: May 2008
  • Posts: 14817
  • Total likes: 10456
  • DansDeals.com Hat Tips 14
    • View Profile
    • Lower Watt Energy Brokers
  • Programs: www.lowerwatt.com
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #450 on: December 10, 2021, 10:36:39 AM »
This came out weird with a wrong price (website)

https://forums.dansdeals.com/index.php?topic=127494.new#new
Feelings don't care about your facts

Offline JoeyShmoe

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Nov 2014
  • Posts: 1235
  • Total likes: 171
  • DansDeals.com Hat Tips 0
  • Gender: Male
    • View Profile
  • Location: Lakewood
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #451 on: December 10, 2021, 10:40:23 AM »
Tried the bot?

It's having some issues I don't have time to deal with.
@aygart seems like the telegram bot is having issues


You can use the below to modify your post (this is what the next version of the extension is gonna generate)
Code: [Select]
[url=https://www.amazon.com/dp/B01MSK6YV6/?tag=cl03f-20&smid=ATVPDKIKX0DER]Skippy Creamy Peanut Butter, 64 Ounce ([s]$7.15[/s] $4.73)[/url][br][br][url=https://www.amazon.com/dp/B01MSK6YV6/?tag=cl03f-20&smid=ATVPDKIKX0DER][img]https://m.media-amazon.com/images/I/615IZgI3RnL._SX679_.jpg[/img][/url]
DDF A-Z Link Extension
Chrome
Firefox
Info

Online aygart

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: May 2008
  • Posts: 14817
  • Total likes: 10456
  • DansDeals.com Hat Tips 14
    • View Profile
    • Lower Watt Energy Brokers
  • Programs: www.lowerwatt.com
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #452 on: December 10, 2021, 10:46:27 AM »
@aygart seems like the telegram bot is having issues


You can use the below to modify your post (this is what the next version of the extension is gonna generate)

This was done on the website.
Feelings don't care about your facts

Offline JoeyShmoe

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Nov 2014
  • Posts: 1235
  • Total likes: 171
  • DansDeals.com Hat Tips 0
  • Gender: Male
    • View Profile
  • Location: Lakewood
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #453 on: December 10, 2021, 10:50:27 AM »
This was done on the website.
I thought I saw the telegram bot signature
DDF A-Z Link Extension
Chrome
Firefox
Info

Offline Yo ssi

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Aug 2019
  • Posts: 5077
  • Total likes: 1804
  • DansDeals.com Hat Tips 53
  • Gender: Male
    • View Profile
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #454 on: December 10, 2021, 11:56:08 AM »
@aygart seems like the telegram bot is having issues


You can use the below to modify your post (this is what the next version of the extension is gonna generate)
Code: [Select]
[url=https://www.amazon.com/dp/B01MSK6YV6/?tag=cl03f-20&smid=ATVPDKIKX0DER]Skippy Creamy Peanut Butter, 64 Ounce ([s]$7.15[/s] $4.73)[/url][br][br][url=https://www.amazon.com/dp/B01MSK6YV6/?tag=cl03f-20&smid=ATVPDKIKX0DER][img]https://m.media-amazon.com/images/I/615IZgI3RnL._SX679_.jpg[/img][/url]
Once your updating it with the original price, it would be nice to mach the style and instead of putting the price in parentheses, have it in bold. I believe that makes it easier to see the sale price.
_    ,
' )  /
 /  / __   _   _   o
(__/_(_)  /_)_/_)_<_
 //
(/

Offline Yo ssi

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Aug 2019
  • Posts: 5077
  • Total likes: 1804
  • DansDeals.com Hat Tips 53
  • Gender: Male
    • View Profile
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #455 on: December 10, 2021, 11:58:46 AM »
This came out weird with a wrong price (website)

https://forums.dansdeals.com/index.php?topic=127494.new#new
I'm aware of the issue you can just modify the price of you can spot it :)
_    ,
' )  /
 /  / __   _   _   o
(__/_(_)  /_)_/_)_<_
 //
(/

Offline WonderingYid

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Jun 2021
  • Posts: 1200
  • Total likes: 176
  • DansDeals.com Hat Tips 2
    • View Profile
  • Location: New York

Offline JoeyShmoe

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Nov 2014
  • Posts: 1235
  • Total likes: 171
  • DansDeals.com Hat Tips 0
  • Gender: Male
    • View Profile
  • Location: Lakewood
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #457 on: December 12, 2021, 03:49:09 PM »
Once your updating it with the original price, it would be nice to mach the style and instead of putting the price in parentheses, have it in bold. I believe that makes it easier to see the sale price.
Apparently, the Chrome Web Store became stricter since 2019, and my extension update was rejected. Need to figure out why and fix it
DDF A-Z Link Extension
Chrome
Firefox
Info

Online YitzyS

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Jan 2015
  • Posts: 4585
  • Total likes: 10030
  • DansDeals.com Hat Tips 34
  • Gender: Male
    • View Profile
  • Location: Lakewood, NJ
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #458 on: December 12, 2021, 07:18:54 PM »
Apparently, the Chrome Web Store became stricter since 2019, and my extension update was rejected. Need to figure out why and fix it
:(  :(  :(

Online YitzyS

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Jan 2015
  • Posts: 4585
  • Total likes: 10030
  • DansDeals.com Hat Tips 34
  • Gender: Male
    • View Profile
  • Location: Lakewood, NJ
Re: Amazon DD Bookmarklet: Have Chrome Make A DDF Friendly Link On Amazon
« Reply #459 on: December 12, 2021, 07:20:47 PM »
Apparently, the Chrome Web Store became stricter since 2019, and my extension update was rejected. Need to figure out why and fix it
I think it's time to change "Don't mess with Google" to "Don't mess with DansDeals, Google!"