GAPI -- Sharing a post to Social Networking Pages from my App

Karthik Reddy challakarthik at gmail.com
Tue Mar 22 06:00:14 EDT 2016


On Tuesday, March 22, 2016 at 9:54:53 AM UTC+5:30, Mark Lawrence wrote:
> On 22/03/2016 04:14, Karthik Reddy wrote:
> > Hi Experts,
> >
> > I am trying to post on facebook and google plus  page  from my application. I am using facebook-sdk an d I am able to post using local machine but I am not able to post from dev server.
> >
> > Can Anyone Please help me on this.
> >
> > Thanks,
> > Karthik
> >
> 
> Please state your OS and Python version, the code that you've tried and 
> exactly what went wrong, including the full traceback if there is one.
> 
> -- 
> My fellow Pythonistas, ask not what our language can do for you, ask
> what you can do for our language.
> 
> Mark Lawrence

Hi Lawrence Thank you for your quick reply  .I am using Ubuntu 14.04 and python 2.7.6 version.


In Template I have written

<button type="button" id="{{ project.id }}" class="btn btn-info"
                                  onclick='publish_project(id);'>
                                    publish
                                </button>

{% block google_script %}
    <script >
        window.___gcfg = {
        lang: 'en',
        parsetags: 'onload',
        isSignedOut: true
        };

        // var sour =  document.getElementById("1");
        // // console.log(sour)
        // var idd=document.getElementById("1").id;
        // console.log(idd)
        function(){ window.open = $("#sharePost").click(); };

    </script>
    <script src="https://apis.google.com/js/platform.js" async defer></script>
{% endblock %}

{% block share %}

<script>
  var options = {
    contenturl: 'http://localhost:8000',
    clientid: 'XXXXXXXXXXXXX.apps.googleusercontent.com',
    cookiepolicy: 'single_host_origin',
    prefilltext: 'New project is added',
    calltoactionurl : 'https://plus.google.com/u/0/112729364286841783635/posts'    
  };
  // Call the render method when appropriate within your app to display
  // the button.
  gapi.interactivepost.render('sharePost', options);
  console.log(new Error().stack);
</script>
{% endblock %}

{% block google_style %}
    <style>
        iframe[src^="https://apis.google.com/u/0/_/widget/oauthflow/toast"] {
            display: none;
        }
    </style>
{% endblock %}





More information about the Python-list mailing list