Google Plus Automated Posting
Got here from SNAP WordPress plugin?
Google+ API library is now included and integrated with the SNAP Pro for WordPress plugin. No separate installation is required.
NextScripts Google+ API library for PHP
You have a site or blog and you are already posting your updates to Facebook, Twitter and some other networks, but what about Google Plus?
Users of the newest Social Network aiming to be on the top are still lacking information about your updates. Google Plus API is still read only, so there were no way to sync your updates around all networks including Google Plus. Now it is. Google Plus Automated Posting script from “NextScripts” is capable of automatically submitting posts from your site directly to your Google Plus account.
NextScripts Google+ API allows you to post simple text messages, “attach” links to text messages with preview text and picture as well as make “Image posts”.
NextScripts Google+ API can post to:
Google+ Profiles | |
Google+ Business Pages | |
Google+ Communities |
Also get a WordPress Plugin that will automatically publish all your posts to Google Plus.
Google+ Automated Posting Demo
Include linked image Include linked URL – some random URL will be attached to the post
it to ourPlease note: Google uses geolocation, so if you are close to the server you will see new post immediately, otherwise post needs to be pushed to Google+ servers near you. Sometimes it takes 2-5 minutes for the post to appear on the Google+ page. If you don’t see the post on our Google+ page immediately, please check it in 2-5 minutes, it will be there.
We need to keep our demo account clean, so any external URLs you type in the field will be removed, Of course, the real API will post everything as is.
Screenshots from WordPress Plugin
Get It
Google+ Automated Posting Script is now part of the universal SNAP API. SNAP API provides a universal API interface for autoposting to more then 25 different social networks including Google+, Pinterest, Flipboard, Reddit, YouTube, Blogger, and LinkedIn Company Pages as well as Facebook, Twitter, Tumblr, Flickr, Scoop.It and many othersGet it here: SNAP API
Usage
The script is very easy to use.Examples:
Please note, those examples are for using SNAP API directly from PHP. if you are looking for auto-posting from WordPress to Google+ you just need the SNAP Pro WordPress plugin. SNAP API Run-Time is built in the SNAP Pro WordPress plugin. No PHP coding is necessary with WordPress.
1. Post simple text message to your Google Plus Profile Stream:
<?php require_once "nxs-api/nxs-api.php"; require_once "nxs-api/nxs-http.php"; require_once "inc/nxs-functions.php"; $email = 'YourEmail@gmail.com'; $pass = 'YourPassword'; $msg = 'Post this to Google Plus!'; $nt = new nxsAPI_GP(); $loginError = $nt->connect($email, $pass); if (!$loginError) { $result = $nt -> postGP($msg); } else echo $loginError; if (!empty($result) && is_array($result) && !empty($result['post_url'])) echo '<a target="_blank" href="'.$result['post_url'].'">New Post</a>'; else echo "<pre>".print_r($result, true)."</pre>"; ?>
1. Post simple message to your Google Plus Business Page Stream:
<?php require_once "nxs-api/nxs-api.php"; require_once "nxs-api/nxs-http.php"; require_once "inc/nxs-functions.php"; $email = 'YourEmail@gmail.com'; $pass = 'YourPassword'; $pageID = '109888164682746252347'; $msg = 'Post this to Google Plus!'; $nt = new nxsAPI_GP(); $loginError = $nt->connect($email, $pass); if (!$loginError) { $result = $nt -> postGP($msg, '', $pageID); } else echo $loginError; if (!empty($result) && is_array($result) && !empty($result['post_url'])) echo '<a target="_blank" href="'.$result['post_url'].'">New Post</a>'; else echo "<pre>".print_r($result, true)."</pre>"; ?>
3. Post message with attached URL to your Google Plus Business Page Stream:
<?php require_once "nxs-api/nxs-api.php"; require_once "nxs-api/nxs-http.php"; require_once "inc/nxs-functions.php"; $email = 'YourEmail@gmail.com'; $pass = 'YourPassword'; $pageID = '109888164682746252347'; $lnk = 'http://www.nextscripts.com/snap-api/'; $msg = 'Post this to Google Plus!'; $nt = new nxsAPI_GP(); $loginError = $nt->connect($email, $pass); if (!$loginError) { $result = $nt -> postGP($msg, $lnk, $pageID); } else echo $loginError; if (!empty($result) && is_array($result) && !empty($result['post_url'])) echo '<a target="_blank" href="'.$result['post_url'].'">New Post</a>'; else echo "<pre>".print_r($result, true)."</pre>"; ?>
4. Post Image with a message to your Google Plus Profile Stream:
<?php require_once "nxs-api/nxs-api.php"; require_once "nxs-api/nxs-http.php"; require_once "inc/nxs-functions.php"; $email = 'YourEmail@gmail.com'; $pass = 'YourPassword'; $pageID = '109888164682746252347'; $lnk = array('img'=>'http://www.nextscripts.com/imgs/nextscripts.png'); $msg = 'Post this to Google Plus!'; $nt = new nxsAPI_GP(); $loginError = $nt->connect($email, $pass); if (!$loginError) { $result = $nt -> postGP($msg, $lnk, $pageID); } else echo $loginError; if (!empty($result) && is_array($result) && !empty($result['post_url'])) echo '<a target="_blank" href="'.$result['post_url'].'">New Post</a>'; else echo "<pre>".print_r($result, true)."</pre>"; ?>
5. Post YouTube video with a message to your Google Plus Profile Stream:
<?php require_once "nxs-api/nxs-api.php"; require_once "nxs-api/nxs-http.php"; require_once "inc/nxs-functions.php"; $email = 'YourEmail@gmail.com'; $pass = 'YourPassword'; $pageID = '109888164682746252347'; //## Link to Video $lnk = 'https://www.youtube.com/watch?v=Dy6MpsDPKts'; $msg = 'Post this to Google Plus!'; $nt = new nxsAPI_GP(); $loginError = $nt->connect($email, $pass); if (!$loginError) { $result = $nt -> postGP($msg, $lnk, $pageID); } else echo $loginError; if (!empty($result) && is_array($result) && !empty($result['post_url'])) echo '<a target="_blank" href="'.$result['post_url'].'">New Post</a>'; else echo "<pre>".print_r($result, true)."</pre>"; ?>
6. Import RSS to Google Plus!
<?php require_once "nxs-api/nxs-api.php"; require_once "nxs-api/nxs-http.php"; require_once "inc/nxs-functions.php"; $email = 'YourEmail@gmail.com'; $pass = 'YourPassword'; $url = 'http://www.YorWebSite.com/rss.xml'; $nt = new nxsAPI_GP(); $loginError = $nt->connect($email, $pass); if (!$loginError) { $doc = new DOMdocument(); $doc->load($url); $rss_array = array(); $items = array(); $tag = 'item'; foreach($doc->getElementsByTagName($tag) AS $node) { $link = $node->getElementsByTagName('link')->item(0)->nodeValue; $title = $node->getElementsByTagName('title')->item(0)->nodeValue; $msg = $title."\r\n"; $msg .= $link."\r\n"; $msg .= $node->getElementsByTagName('description')->item(0)->nodeValue; $result[] = $nt -> postGP($msg, $lnk, $pageID); } } else echo $loginError; echo "<pre>".print_r($result, true)."</pre>"; ?>
7. New in 2.5 Post to the community
<?php require_once "nxs-api/nxs-api.php"; require_once "nxs-api/nxs-http.php"; require_once "inc/nxs-functions.php"; $email = 'YourEmail@gmail.com'; $pass = 'YourPassword'; $commID = '108350938519387916012'; $commCategoryID = '0ae89207-2702-446b-815b-18be9ecf1122'; $lnk = 'http://www.nextscripts.com/snap-api/'; $msg = 'Post this to Google Plus!'; $nt = new nxsAPI_GP(); $loginError = $nt->connect($email, $pass); if (!$loginError) { $result = $nt -> postGP($msg, $lnk, '', $commID, $commCategoryID); } else echo $loginError; if (!empty($result) && is_array($result) && !empty($result['post_url'])) echo '<a target="_blank" href="'.$result['post_url'].'">New Post</a>'; else echo "<pre>".print_r($result, true)."</pre>"; ?>
Requirements
PHP5, cURL with OpenSSL.Blogger
NextScripts Blogger API and more stable and has more features then standard Blogger API. For example standard Blogger API cuts embedded videos from the posts. NextScripts Blogger API has no such limitations. Blogger support is included since version 2.0.YouTube
You can make autoposts to your YouTube feed. (example – http://www.youtube.com/nextscripts)Get It
Google+ Automated Posting Script is now part of the universal SNAP API. SNAP API provides a universal API interface for autoposting to more then 25 different social networks including Google+, Pinterest, Flipboard, Reddit, YouTube, Blogger, and LinkedIn Company Pages as well as Facebook, Twitter, Tumblr, Flickr, Scoop.It and many othersGet it here: SNAP API
Version history
Version 2.15.69 – Feb 27, 2015
– [Update] – Fix to for the recent interface changes.
Version 2.9.0 – Jan 14, 2014
– [Update] – Post to Communities as Page. Compatibility fixes.
Version 2.8.0 – July 10, 2013
– [Update] – New G+ interface support
Version 2.5.8 – Feb 1, 2013
– [New] – YouTube support
Version 2.6.30 – Apr 16, 2013
– [New] – Communities posting.
Version 2.4.5 – Jan 8, 2013
– [New] – Bug fixes and stability improvements.
Version 2.3.0 – Oct 10, 2012
– [New] – Image posting.
Version 2.0.9 – Sept 06, 2012
– [Improvement] – Better SSL handling.
Version 2.0.8 – Sept 06, 2012
– [BugFix] – Fixed “quotes” characters. {Broken by Google}
Version 2.0.7 – Aug 31, 2012
– [BugFix] – Fixed publishing of new lines in messages
Version 2.0.2 – Aug 16, 2012
– [BugFix] – Update to the latest Google+ release
Version 2.0.1 – May 18, 2012
– [Change] – Cookie files are mo longer required
Version 1.2.1 – Feb 28, 2012
– [BugFix] – Incorrect line break handling.
– [WP Plugin] – New Setting – Optional message to Announce Post.
Version 1.2.0 – Feb 27, 2012
– [Added] Ability to post/attach linked URLs- [Added] Ability to post/attach linked images
– [WP Plugin] Changed Settings Screen
Version 1.0.1 – Feb 20, 2012
– [BugFix] – Correct login – Incorrect page access.
Version 1.0.0 – Feb 01, 2012
– Initial Release