Posting Activity

0 views
Skip to first unread message

Viveka

unread,
Sep 13, 2008, 9:14:45 AM9/13/08
to Orkut Developer Forum
What is the best practice to post activity while running the app under
iframe?

I am developing an app that is written in PHP. Orkut app calls the
javascript, js submits the form to PHP program and PHP program execute
the app. Once the control is handed over to PHP, I have no way of
accessing opensocial APIs. I am thinking of following ways to post the
activity.

1. Run a cron job to take the recent activity from the database and
post it using opensocial.requestCreateActivity.
2. Execute makeRequest API when a user views the app in profile view
and get the activity data and post it.

Is there a better way to do it?

Jason

unread,
Sep 15, 2008, 5:42:31 PM9/15/08
to Orkut Developer Forum
Until the REST API is available, you can use the gadgets.rpc library
to issue a remote procedure call to your OpenSocial application to
trigger a JavaScript function that posts a new activity. For more on
gadgets.rpc, see these resources:

http://code.google.com/apis/opensocial/docs/0.8/reference/gadgets/#gadgets.rpc
http://code.google.com/p/opensocial-resources/wiki/RPC

- Jason

Rudá Porto Filgueiras

unread,
Sep 17, 2008, 8:21:08 AM9/17/08
to opensoci...@googlegroups.com
There is any prevision about REST API in sandbox?

--
=====================================
Rudá Porto Filgueiras
Weimar Consultoria

http://python-blog.blogspot.com

Hospedagem Plone, Django, Zope 3, Grok...
http://www.pytown.com
=====================================

Jason

unread,
Sep 17, 2008, 7:31:30 PM9/17/08
to Orkut Developer Forum
No formal estimate just yet but relatively soon. We'll definitely post
a note on the blog when it's ready.

http://orkutdeveloper.blogspot.com/

- Jason

On Sep 17, 5:21 am, "Rudá Porto Filgueiras" <rud...@gmail.com> wrote:
> There is any prevision about REST API in sandbox?
>
>
>
> On Mon, Sep 15, 2008 at 6:42 PM, Jason <apija...@google.com> wrote:
>
> > Until the REST API is available, you can use the gadgets.rpc library
> > to issue a remote procedure call to your OpenSocial application to
> > trigger a JavaScript function that posts a new activity. For more on
> > gadgets.rpc, see these resources:
>
> >http://code.google.com/apis/opensocial/docs/0.8/reference/gadgets/#ga...

Jason

unread,
Sep 19, 2008, 3:54:06 PM9/19/08
to Orkut Developer Forum
Note that gadgets.rpc does not work reliably across containers or
browsers and is not secure, so I would wait just a bit longer for the
REST API or restructure your application to request an HTML stream
from your back-end using gadgets.io.makeRequest and just load it in
the gadget directly instead of displaying an IFrame. See my disclaimer
at the top of the article for more details.

- Jason

On Sep 15, 2:42 pm, Jason <apija...@google.com> wrote:
> Until the REST API is available, you can use the gadgets.rpc library
> to issue a remote procedure call to your OpenSocial application to
> trigger a JavaScript function that posts a new activity. For more on
> gadgets.rpc, see these resources:
>
> http://code.google.com/apis/opensocial/docs/0.8/reference/gadgets/#ga...http://code.google.com/p/opensocial-resources/wiki/RPC
Reply all
Reply to author
Forward
0 new messages