Simulate a click, like sharing a link to Google+ without clicking


My challenge is to make a sharing of my site to Google+ without clicks.

I have an account with google [email protected] , I created a profile in G+ .

The idea is through localhost to create a script where when it is accessed it will perform the task of sharing a link in the G+ stream.

Well, in my searches, there are several types of profiles in G +:

Common person profile

A community

And one page

In the APis documentation for Explorer we see 2 different APIs for G+ :

And in the comparison table it is said:

G + API "Write posts to the stream" NO

G + Domains API "Yes, restricted to the domain."

I could not understand the operation of this API "Domains"

For this reason and to see several questions about this saying that there is no public API to automatically post to the G+ stream, I gave up using the API.

So I'm trying to use sharing and simulate confirmation clicks to automatically share a link from my site to G+ , from this code:

<!doctype html>
        <title>Teste share G+</title>
    <body onload="alert('hiii');document.getElementById('share_g').click();">
        <a href="" id="share_g" onclick=",
  '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');document.querySelector('span.RveJvd snByac').click(); return false;"><img
  src=""alt="Share on Google+"/></a>


However it is necessary to click on the POSTAR button to perform the operation, there is some way to simulate this click. with javascript or phantomjs?

Any other solution is welcome.

asked by anonymous 16.11.2017 / 11:33

1 answer


Use something like this:


Supported including IE

With jquery you can do this:

16.11.2017 / 12:11