Here's a quick regular expression that you can use:

var match = window.location.toString().match(/#gadgetId=(\d*)&/);
if (match) {
  output(match[1]);
}

Cheers!
- Jason

On Oct 14, 3:47 am, rd-london <[EMAIL PROTECTED]> wrote:
> Hi Jason,
> All very helpful, many thanks.
>
> You say:
>
> "
> In this
> case, you can retrieve the current window location to get the gadget's
> ID and build the link manually:
> "
>
> What's the recommended way of doing this? Of getting the current
> window location and then extracting the gadget's ID?
>
> Many thanks,
> R
>
> On Oct 13, 10:12 pm, Jason <[EMAIL PROTECTED]> wrote:
>
> > 1. There may be a simpler solution in the future, but for now, the
> > most straightforward way to determine whether a user has an app is to
> > fetch the VIEWER object and determine whether it's non-null. If so,
> > the user has your app installed. Otherwise, your app doesn't have
> > access to the user's information and the object returned is null.
>
> > 2. The developer guidelines do not allow direct links to install the
> > current app because orkut provides this already. However, you are
> > permitted to redirect the user to the install page IF they try to take
> > a certain action that requires they have the app installed (e.g.
> > posting a review, recording their high score, and so on). In this
> > case, you can retrieve the current window location to get the gadget's
> > ID and build the link manually:
>
> >http://www.orkut.com/Main#AppInfo.aspx?appId=[gadget ID]
>
> > I hope this helps. Let me know if you have any follow-ups.
>
> > - Jason
>
> > On Oct 10, 9:17 am, rd-london <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > Got an OpenSocial application, wonder if someone can help.
>
> > > How can one easily test if a user has already installed the
> > > application?
>
> > > Also - what's the best way to provide a link that the user can click
> > > on to install the application if it isn't already installed - an add-
> > > to-profile button/link in other words.
>
> > > Thanks for any help,
> > > R
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Orkut Developer Forum" group.
To post to this group, send email to opensocial-orkut@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to