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

Offline Dan

  • Administrator
  • Dansdeals Lifetime 40K Presidential Platinum Elite
  • **********
  • Join Date: May 2008
  • Posts: 47885
  • Total likes: 656
  • DansDeals.com Hat Tips 15685
  • Gender: Male
    • View Profile
  • Location: CLE
  • Programs: UA Global Services, AA Lifetime Plat, DL Dirt, SPG Plat, Hyatt Diamond, Fairmont Lifetime Plat, Hilton Diamond, Priority Club Plat, Avis Chairman, National EE, Hertz PC
I just created a bookmarklet 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.

Here's the code:
Code: [Select]
javascript:(function(){

    var pattern = new RegExp("(https:\/\/www.amazon.com\/).*([dg]p\/)(?:product\/)?(..........).*", "i");
    var match = location.href.match(pattern);
    var URL = match[1] + "dp/" + match[3] +"/?tag=cl03f-20&smid=ATVPDKIKX0DER";
window.prompt("Press control-c","[url="+URL+"]"+document.title+"[/url]");void(0);

})()

As a reminder, to create a 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 posted above.

Maybe a mod can add it to this thread: When Posting Amazon Deals, Please Make A DD Link

It might need a little tweaking, so let me know if you have a link that it doesn't work on.
Save your time, I don't answer PM. Post it in the forum and a dedicated DDF'er will get back to you as soon as possible.

Offline aygart

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: May 2008
  • Posts: 4819
  • Total likes: 452
  • DansDeals.com Hat Tips 5
    • View Profile
    • Lower Watt Energy Brokers
  • Programs: www.lowerwatt.com
I think this deserves a HT
You have the right to remain silent. Anything you say can and will be used to start a religious discussion.

Offline stooges44

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Jan 2017
  • Posts: 3389
  • Total likes: 173
  • DansDeals.com Hat Tips 152
    • View Profile
Re: Amazon DD Bookmarklet
« Reply #2 on: May 17, 2017, 11:16:31 PM »

Offline myi

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Feb 2015
  • Posts: 9058
  • Total likes: 385
  • DansDeals.com Hat Tips 151
    • View Profile
  • Location: brklyn/Israel
@etech0 Really a great piece of art work.
 Should be added to the original rules about posting an amazon link.(this is an amazing way to post when your on a computer, especially a computer which is yours.)
 While we're still using this simple machine forum layout, I think there should be an amazon link added to one of the buttons(next to the url and img presets.) to allow you to have an amazon link posted and leave you with the Asin to fill in.
(would be amazing to have for those using a mobile phone and for those addicts who will be on ddf from every computer they can get a hold off, which will allow them to post an amazon deal with a click of a button.)
 Thanks @Dan
Don't try to be someone else , be who you are because everyone else is taken.

Offline etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 8590
  • Total likes: 138
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
@etech0 Really a great piece of art work.
Thank you
While we're still using this simple machine forum layout, I think there should be an amazon link added to one of the buttons(next to the url and img presets.) to allow you to have an amazon link posted and leave you with the Asin to fill in.
(would be amazing to have for those using a mobile phone and for those addicts who will be on ddf from every computer they can get a hold off, which will allow them to post an amazon deal with a click of a button.)
 Thanks @Dan
+1, especially if it could pull in the product title and an image
Workflowy. You won't know what you're missing until you try it.

Offline Davidthebest

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Dec 2014
  • Posts: 4186
  • Total likes: 206
  • DansDeals.com Hat Tips 304
    • View Profile

Sorry Im so not familiar in the tech world... didn't understand what It says.. How would it format automatically into a DDF link, can someone please  explain step by step what I gota do?

Offline jj1000

  • Administrator
  • Dansdeals Lifetime Presidential Platinum Elite
  • **********
  • Join Date: Jun 2008
  • Posts: 9325
  • Total likes: 304
  • 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.
Sorry Im so not familiar in the tech world... didn't understand what It says.. How would it format automatically into a DDF link, can someone please  explain step by step what I gota do?
This'll only be helpful on a computer.
See my 5 step program to your left <--

(Real signature under my location)

Give More Likes, It's Free!

Offline Davidthebest

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Dec 2014
  • Posts: 4186
  • Total likes: 206
  • DansDeals.com Hat Tips 304
    • View Profile
This'll only be helpful on a computer.
No way to make it work on my android  browser?

Offline etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 8590
  • Total likes: 138
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
Thanks for the new title! One thing to note: bookmarklets work in all desktop browsers, not just Chrome.
Workflowy. You won't know what you're missing until you try it.

Offline jj1000

  • Administrator
  • Dansdeals Lifetime Presidential Platinum Elite
  • **********
  • Join Date: Jun 2008
  • Posts: 9325
  • Total likes: 304
  • 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.
No way to make it work on my android  browser?
No

ETA: Now the question is why don't you have a laptop already?
See my 5 step program to your left <--

(Real signature under my location)

Give More Likes, It's Free!

Offline Davidthebest

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Dec 2014
  • Posts: 4186
  • Total likes: 206
  • DansDeals.com Hat Tips 304
    • View Profile
No

ETA: Now the question is why don't you have a laptop already?
Same reason why i don't have a office... Why do I need one?...

Offline jj1000

  • Administrator
  • Dansdeals Lifetime Presidential Platinum Elite
  • **********
  • Join Date: Jun 2008
  • Posts: 9325
  • Total likes: 304
  • 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.
Same reason why i don't have a office... Why do I need one?...
It's easier to make Amazon links and surf DDF on one of course.
See my 5 step program to your left <--

(Real signature under my location)

Give More Likes, It's Free!

Offline etech0

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2013
  • Posts: 8590
  • Total likes: 138
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
ETA: Now the question is why don't you have a laptop already?
Probably waiting for one that's LEOA
Workflowy. You won't know what you're missing until you try it.

Offline Davidthebest

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Dec 2014
  • Posts: 4186
  • Total likes: 206
  • DansDeals.com Hat Tips 304
    • View Profile
It's easier to make Amazon links and surf DDF on one of course.
Want to make me even more addicted ?

Offline myi

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Feb 2015
  • Posts: 9058
  • Total likes: 385
  • DansDeals.com Hat Tips 151
    • View Profile
  • Location: brklyn/Israel
Want to make me even more addicted ?
There's not much more to be addicted to, then what you are. Lol ;) (you've reached the max! :)
Probably waiting for one that's LEOA
More like a $200 price drop.. that seems to be the new way to attract jj/dans attention for a post.
No way to make it work on my android  browser?
Like jj said no, but should you upgrade to a computer one of these days hit back to this thread and someone I'm sure wouldn't mind to help you out or even myself would show you what to do.

I just created a bookmarklet 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.

Here's the code:
Code: [Select]
javascript:(function(){

    var pattern = new RegExp("(https:\/\/www.amazon.com\/).*([dg]p\/)(?:product\/)?(..........).*", "i");
    var match = location.href.match(pattern);
    var URL = match[1] + "dp/" + match[3] +"/?tag=cl03f-20&smid=ATVPDKIKX0DER";
window.prompt("Press control-c","[url="+URL+"]"+document.title+"[/url]");void(0);

})()

As a reminder, to create a 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 posted above.

Maybe a mod can add it to this thread: When Posting Amazon Deals, Please Make A DD Link

It might need a little tweaking, so let me know if you have a link that it doesn't work on.
In chrome it's the same you still have to make a fresh bookmark and then once your in the bookmark you can right click and find the text add page.
 
Thank you+1, especially if it could pull in the product title and an image
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
Don't try to be someone else , be who you are because everyone else is taken.