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

2

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>
<html>
    <head>
        <title>Teste share G+</title>
    </head>
    <body onload="alert('hiii');document.getElementById('share_g').click();">
        <a href="https://plus.google.com/share?url=http://www.example.com" id="share_g" onclick="javascript:window.open(this.href,
  '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');document.querySelector('span.RveJvd snByac').click(); return false;"><img
  src="https://www.gstatic.com/images/icons/gplus-64.png"alt="Share on Google+"/></a>

    </body>
</html>

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

0

Use something like this:

document.getElementById('elementID').click();

Supported including IE

With jquery you can do this:

$("#mytest1").click();
    
16.11.2017 / 12:11