Looks like osapi peoplehelpers are defined in a onload handler, your code runs before then.
If you wrap it like this it should work: gadgets.util.registerOnLoadHandler(function() { ... }); On Wed, Mar 17, 2010 at 12:13 PM, Chirag Shah <chiragsh...@gmail.com> wrote: > Ah sorry about that. Here's the gadget that's failing for me. It complains > about getViewer being unknown. Does it work for you? > > <?xml version="1.0" encoding="UTF-8"?> > <Module> > <ModulePrefs title="osapi"> > <Require feature="opensocial-0.9"/> > <Require feature="osapi"/> > </ModulePrefs> > <Content type="html" view="default"> > <![CDATA[ > osapi hello > <script> > osapi.people.getViewer().execute(function(result) { > console.log(result.name.givenName); > }); > </script> > ]]> > </Content> > </Module> > > Thanks, > Chirag > > On Wed, Mar 17, 2010 at 1:46 PM, Paul Lindner <lind...@inuus.com> wrote: > > > Right now I can't connect to etherpad.com.. Can you send the sample > code? > > > > The gadgets in the endtoend test use osapi and they're working fine. > > > > On Wed, Mar 17, 2010 at 10:09 AM, Chirag Shah <chiragsh...@gmail.com> > > wrote: > > > > > It looks like most osapi methods aren't working for me on trunk. Is > this > > > true for anybody else? > > > Here's the gadget i'm using: > > > http://etherpad.com/ep/pad/export/osapi/latest?format=txt > > > http://etherpad.com/osapi > > > > > > -Chirag > > > > > > On Tue, Mar 16, 2010 at 4:55 PM, Paul Lindner <lind...@inuus.com> > wrote: > > > > > > > okay, looks like these changes don't overlap, so I'll go ahead with > my > > > > commits. > > > > > > > > thanks! > > > > > > > > > > > > On Tue, Mar 16, 2010 at 2:22 PM, John Hjelmstad <fa...@google.com> > > > wrote: > > > > > > > > > Yes, both cls will be committed today. > > > > > > > > > > On Tuesday, March 16, 2010, Paul Lindner <lind...@inuus.com> > wrote: > > > > > > ah, nice. could you apply that then? I have enough changes > coming > > > > down > > > > > the > > > > > > pipe without me touching something that you're actively > > > refactoring... > > > > > > > > > > > > > > > > > > On Tue, Mar 16, 2010 at 2:01 PM, John Hjelmstad < > fa...@google.com> > > > > > wrote: > > > > > > > > > > > >> Yeah... the additional parsing restrictions were a mistake. I've > > got > > > > one > > > > > CL > > > > > >> (which you reviewed) pulling back the host verification stuff, > and > > > Ziv > > > > > is > > > > > >> easing up the start/end beacon parsing thing as well. > > > > > >> > > > > > >> --John > > > > > >> > > > > > >> On Tue, Mar 16, 2010 at 1:29 PM, Paul Lindner < > lind...@inuus.com> > > > > > wrote: > > > > > >> > > > > > >> > actually itwas samplecontainer that was broken. If you load > any > > > > > gadget > > > > > >> > with script tags you'll get failures (such as labpixies.. > etal) > > > > > >> > > > > > > >> > > > > > > >> > On Tue, Mar 16, 2010 at 1:16 PM, John Hjelmstad < > > fa...@google.com > > > > > > > > > >> wrote: > > > > > >> > > > > > > >> > > On Tue, Mar 16, 2010 at 12:43 PM, Paul Lindner < > > > > > plind...@linkedin.com > > > > > >> > > >wrote: > > > > > >> > > > > > > > >> > > > Hi, > > > > > >> > > > > > > > > >> > > > I've been digging back into the source and found a few > > things > > > of > > > > > >> note: > > > > > >> > > > > > > > > >> > > > DefaultConcatUri causes many gadgets to fail because it > has > > a > > > > > >> hardcoded > > > > > >> > > > hostname of localhost:9003 I'll probably reuse the %host% > > > idiom > > > > to > > > > > >> get > > > > > >> > > this > > > > > >> > > > to pass for the moment.. > > > > > >> > > > > > > > > >> > > > > > > > >> > > %host% should work nicely for this, thanks Paul. Even so, > I'm > > > > > surprised > > > > > >> > > this > > > > > >> > > was causing problems. The trunk was clean for me... which > > > test(s) > > > > > >> errored > > > > > >> > > out? > > > > > >> > > > > > > > >> > > > > > > > >> > > > > > > > > >> > > > The end-to-end tests are ignoring their errors, probably > > since > > > > the > > > > > >> > junit4 > > > > > >> > > > upgrade. The osapi tests in there are using an older > > version > > > of > > > > > the > > > > > >> > api > > > > > >> > > > and > > > > > >> > > > are broken. Two endtoend caja tests are failing with > > errors: > > > > > >> > > > > > > > > >> > > > SEVERE: Job run failed with unexpected RuntimeException: > > > Error: > > > > > >> > Already > > > > > >> > > > tames to something: [object Object] ( > > > > > >> > > > > > > > > >> > > > > > > > > >> > > > > > > > >> > > > > > > >> > > > > > > > > > > > > > > > http://localhost:9003/gadgets/js/caja.js?v=75fe169d11a71cf89a927e188571bf&container=default&debug=0#49 > > > > > >> > > > ) > > > > > >> > > > > > > net.sourceforge.htmlunit.corejs.javascript.JavaScriptException: > > > > > >> Error: > > > > > >> > > > Already tames to something: [object Object] ( > > > > > >> > > > > > > > > >> > > > > > > > > >> > > > > > > > >> > > > > > > >> > > > > > > > > > > > > > > > http://localhost:9003/gadgets/js/caja.js?v=75fe169d11a71cf89a927e188571bf&container=default&debug=0#49 > > > > > >> > > > ) > > > > > >> > > > > > > > > >> > > > > > > > > >> > > > htmlunit is also complaining heavily about ampersands in > > URLs, > > > > > which > > > > > >> we > > > > > >> > > > should really fix -- and it appears that some of the > > > javascript > > > > > >> doesn't > > > > > >> > > run > > > > > >> > > > synchronously, breaking yet more tests... > > > > > >> > > > > > > > > >> > > > phew.. > > > > > >> > > > > > > > > >> > > > I'll have some quick fixes today. > > > > > >> > > > > > > > > >> > > > > > > > >> > > > > > > >> > > > > > > > > > > > > > > > > > > > > >