Social Media Auto Post on Google Plus Using PHP API

Social Media Auto Post on Google Plus Using PHP API

Today, We want to share with you Social Media Auto Post on Google Plus Using PHP API.
In this post we will show you google plus auto poster, hear for How To Post Blog Posts on Google Plus Automatically? we will give you demo and example for implement.
In this post, we will learn about Auto Post to Google+ using PHP with an example.

Google product has very closed the good and dynemic loophole and this PHP source code no longer works.

READ :  Flowroute Sending SMS API using PHP

How To Post Blog Automatically Posts on Google Plus?

Here simple Example of the Automatically post to google+ source code for HTML, javascript and PHP serevr side below Example.

[php]
function getPlus($myurl)
{
$live_curl = curl_init();
curl_setopt($live_curl, CURLOPT_URL, “https://clients6.google.com/rpc”);
curl_setopt($live_curl, CURLOPT_POST, 1);
curl_setopt($live_curl, CURLOPT_POSTFIELDS, ‘[{“method”:”pos.plusones.get”,”id”:”p”,”params”:{“nolog”:true,”id”:”‘ . rawurldecode($myurl) . ‘”,”source”:”widget”,”userId”:”@viewer”,”groupId”:”@self”},”jsonrpc”:”2.0″,”key”:”p”,”apiVersion”:”v1″}]’);
curl_setopt($live_curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($live_curl, CURLOPT_HTTPHEADER, array(‘Content-type: application/json’));
$results_data = curl_exec ($live_curl);
curl_close ($live_curl);
$data_json = json_decode($results_data, true);
return intval( $data_json[0][‘result’][‘metadata’][‘globalCounts’][‘count’] );
}
[/php]

post on google plus using api php

second things is the HTML button source code to open a new window layouts.

[php]
<a
href="https://plus.google.com/share?url=”
onClick=”return google_click(400, 300)” target=”_blank”
title=”Share This on Google+”
>Share on Google+
[/php]

READ :  how to get last inserted id in laravel 6?

Auto Post to Google Plus using javascript

This is a simple the javascript source code for Auto Post to Google+ using PHP

[php]

function google_click(width, height)
{
var live_left_pos, live_top_pos;
live_left_pos = (window.screen.width / 2) – ((width / 2) + 10);
live_top_pos = (window.screen.height / 2) – ((height / 2) + 50);
var windowFeatures = “status=no,height=” + height + “,width=” + width + “,resizable=yes,left=” + live_left_pos + “,top=” + live_top_pos + “,screenX=” + live_left_pos + “,screenY=” + live_top_pos + “,toolbar=no,menubar=no,scrollbars=no,location=no,directories=no”;
var url=location.href;
var title=document.title;
window.open(‘https://plus.google.com/share?url=’+encodeURIComponent(url)+’&t=’+encodeURIComponent(title),’sharer’, windowFeatures);
return false;
}

[/php]

We hope you get an idea about How to automatically post to google+ with php
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

READ :  jQuery Ajax Image Upload using PHP Example

We hope This Post can help you…….Good Luck!.

Leave a Comment