Browse Source

Updated README

Ari Bader-Natal 4 years ago
  1. 49


@ -1,46 +1,51 @@
Make it easier for others to quote you and your work in their blogs.
# WP Reblog Button
## What
Every WordPress instance ships with a bookmarklet-based tool ([Press This]( that authors can use to easily create a new WordPress post that quotes selected text from any other website [with attribution](, onto their own WordPress blog.
WordPress ships with a blog-specific [Press This]( bookmarklet, which allows a blog author to select/highlight content from any website and quote it, [with attribution](, on their own WordPress blog.
This project creates an alternate interface for this quote-and-reblog functionality, packaging it as a button that a page author can add to the ubiquitous set of social sharing buttons. This way, readers are provided with a way to easily share quotes from the page author's page onto their own WordPress site.
This project extends Press This functionality in two ways:
Something like this reblog functionality already exists within the network reader, but I'm not aware of any comparable functionality that also supports self-hosted Wordpress sites. This project supports all up-to-date WordPress instances, regardless of where they are hosted.
1. It moves the UI from the browser Favorites bar into the web itself, embeddable on any web page.
2. It untethers the functionality from one specific WordPress server, instead allowing a viewer to specify their own WordPress server, wherever that may be.
## Why
## Demo
I added the Reblog button to every page on [my blog](, so feel free to try it on any post there. The clip below shows me reblogging a post about the ["fixed-effort" bicycle concept]( to a self-hosted Wordpress blog at [](
It's worth noting two bits of polish that streamline usage:
1. Text can be selected either before or after clicking the Reblog button.
2. Once you enter your WP blog URL once, the URL will be saved for that domain, so you won't need to retype it the next time.
Taking advantage of both of these, it's a bit faster to use:
I built this as a proof-of-concept based on a [tweet to Mike Caulfield.](
## Usage
Simply add this to your HTML in the same way you would any other "Share" embed.
<div id="reblog-this-button" unselectable="on" class="unselectable"></div>
<script type="text/javascript">var wpPressThisButtonServer="";!function(d,i){if(!d.getElementById(i)){var j=d.createElement("script");;j.src=wpPressThisButtonServer+"/wp-pressthis-button.js?v=1";var w=d.getElementById(i);d.body.appendChild(j);}}(document,"reblog-btn-js");</script>
## Self-host
Store the contents of the `src` directory wherever you like, then change the `wpPressThisButtonServer` variable in the code snippet to match the hosting location.
## Self-hosting
## Develop
If you'd rather self-host this than load it from the CloudFront CDN, upload the contents of the [src]( directory to any web-accessible location. Update the `wpPressThisButtonServer` variable in the code snippet above to match this root location.
Serve the button locally `cd src && python -m SimpleHTTPServer 8000` and open `http://localhost:8000/`
## Demo
## Developing
You can try this yourself on any post on my blog, such as one describing a ["fixed-effort" bicycle concept.](
If you'd like to modify the code, you can easily run it locally. `cd src && python -m SimpleHTTPServer 8000` to start the server locally, then point your browser at `http://localhost:8000/` to get started with a functional demo.
## License
The blog URL is saved, so subsequent uses are streamlined:
As this builds on the [Press This]( code from Wordpress, it also uses the [GPLv2](LICENSE) license.
## Motivation
## License
I built this as a proof-of-concept of an idea mentioned in a [tweet to Mike Caulfield.](
Builds on the [Press This]( code from Wordpress, so [GPLv2](LICENSE).