user1505254
user1505254

Reputation:

Pinterest "Pin It" button hack

I'm looking for a way to create a button which I can place next to every item on a page.

When the users clicks that button it automatically grabs the image of whatever item it's next to and automatically posts it to that user's Pinterest board (using the same description).

I've been searching for a couple days now for a way to do this without much luck, all I've come across is these two sites:

http://www.nextscripts.com/pinterest-automated-posting

http://www.brandaiddesignco.com/blog/add-a-custom-pinterest-pin-it-button-to-your-website/375/#

Upvotes: 2

Views: 4003

Answers (1)

Bergi
Bergi

Reputation: 664936

Just have a look at this script which is brought to you by pinterest.com/about/goodies: "Pin It Button for Web Sites". Deobfuscate it at http://jsbeautifier.org/ and see what it does:

  • It takes all <a> elements in the document and when their href attribute contains the string "//pinterest.com/pin/create/button/?",
  • it replaces them with a iframe (http://pinit-cdn.pinterest.com/pinit.html?...), its properties depending on the URI and other attributes of the link.

Now, you should be able to write a script that takes all your buttons, grabs the image next to it (However that will work, depends on your DOM) and creates such iframes.

If you don't want the popups, you might have a look at the iframes / popups source code and post directly to the address you find there.

I've come across is these two sites:

http://www.nextscripts.com/pinterest-automated-posting is a non-free wordpress plugin, including an API for posting to pinterest (because they don't have one themselves). You can only guess what happens in the PHP code until you buy it.

http://www.brandaiddesignco.com/blog/add-a-custom-pinterest-pin-it-button-to-your-website/375/# just dynamically loads this script when you click on that button, and the script then creates a GUI to select images from the page.

Upvotes: 3

Related Questions