Introducing WPGPlus: Posting from WordPress to Google+

Inspired by seeing comments in Google+ about the need for a WordPress cross-post, I whipped up a quick WordPress plugin: WPGPLus.

For now, since the Google+ API is read-only, I’m borrowing inspiration from Luka Puši?’s GPlus Bot and Dmitry Sandalov’s Twitter 2 Google Plus script.

This means emulating the Google+ mobile web experience using Curl.

WPGPlus adds a box to the post edit screen where you can choose yes/no for publishing to Google+, as well as a place for a message to be used in the body.

(If you provide a Google+ message it is used; if you provide a post excerpt it is used; otherwise post content is used).

Anyway, check it out and let me know what you think!

Did you like this? Share it:
14 Comments. Leave a comment or send a Trackback.
  1. Pingback
  2. Pingback
  1. #1 • BandonRandon said on February 2 2012:
     

    Cool, just installed this. Will let you know how it goes :)

  2. #2 • Android Tablet Apps said on February 12 2012:
     

    Does this have the ability to post to Google+ Pages and not just personal profiles?

  3. #3 • John said on February 12 2012:
     

    Not currently, no. Love to see it in the future, though it might need to wait for an official API from Google.

  4. #4 • Ari Herzog said on February 17 2012:
     

    In-ter-es-ting, I’ll check this out John. Always the plugin innovator!

  5. #6 • Ari Herzog said on February 17 2012:
     

    Uh oh. I have an error. I test the plugin by publishing a new post and filling in the box there, and get:

    Warning: fwrite(): supplied argument is not a valid stream resource in /home/content/57/7282057/html/wp-content/plugins/wpgplus/gplus.php on line 55

    Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ‘;’ in Entity, line: 60 in /home/content/57/7282057/html/wp-content/plugins/wpgplus/gplus.php on line 72

    Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ‘;’ in Entity, line: 60 in /home/content/57/7282057/html/wp-content/plugins/wpgplus/gplus.php on line 72

    Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ‘;’ in Entity, line: 60 in /home/content/57/7282057/html/wp-content/plugins/wpgplus/gplus.php on line 72

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/57/7282057/html/wp-content/plugins/wpgplus/gplus.php:55) in /home/content/57/7282057/html/wp-includes/pluggable.php on line 866

  6. #7 • Herbert Schmidt said on February 18 2012:
     

    I got the same errror warning.
    After I installed the developer version of WPGPlus this warning doesn’t anymore occur.
    But I have an other problem. Nothing is publisher on my G+ account. ;-)
    I am in discussion with Jophn and mBurke (he is German).

  7. #8 • John said on February 18 2012:
     

    Ari – can you install the development version and try that?

    You can get it at http://wordpress.org/extend/plugins/wpgplus/download/

  8. #9 • Ari Herzog said on February 18 2012:
     

    The dev version doesn’t cause any errors… but when publishing a post, nothing appears on G+ (despite using the correct email/pass in the settings).

    You can delete the trackbacks, btw. It’s not live yet as I unpublished it.

  9. #10 • John said on February 18 2012:
     

    Thanks Ari.

    I’d encourage everyone to follow the discussion over in the WordPress support forum for WPGPlus.

    In fact I’ll probably disable comments here just so as not to use this comments thread for troubleshooting – far better to use the forum.

  10. #12 • Joe said on April 20 2013:
     

    Just a quick question. I just installed the plugin and enabled it, it has been a few minutes but none of the posts have appeared in Google+. Is it not working for me or does it just take some time for the post to appear?

  11. #13 • Joe said on April 20 2013:
     

    Sorry about that last comment did not read the post above it. About Support.

  12. #14 • John said on April 20 2013:
     

    Posts only get posted when you publish them – existing posts won’t get published.

    I should also note the plugin is quite “beta” – you’ll see in the support threads in the forums you’ll likely need to make some changes to get it working.

    I believe, for now, the best approach is to edit line 36 of gplus.php to set redirection to 5 instead of 0 – but I haven’t had time to troubleshoot / debug and publish a new version.

    (I’m working to publish a 0.8.5 version which at least fixes this issue)