Well, If I sign out and try to use the URL+token it gives me an error, too.
On Dec 14, 4:48 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hey Austin, thank you very much. > > (In fact, the problem was the extra []). > > But it just helped a bit since now the script keeps asking for > authentication and never inserts the entry! > > You can try it in:http://paginas.fe.up.pt/~ei00073/gcalendar/index.html > > If I comment the logMeIn() function as try the URL+token: > > http://paginas.fe.up.pt/~ei00073/gcalendar/index.html#2%2Fsh5qGtnnbdh... > > It gives me the title of the feed but it doesn't insert the entry > asking for authentication. > > I don't know what to do. > > Thanks > > On Dec 14, 3:36 am, "Austin (Google)" <[EMAIL PROTECTED]> wrote: > > > Hi, > > > One of the first problem I noticed is the inclusion of all the "[]" within > > all array bracket. I believe you copy the source code directly from "view > > source". The extra "[]" are inserted because of the templating system we > > use, and it is not intended to be the actual code. Try removing them to see > > if it works. > > > Austin > > > On Dec 13, 2007 7:14 PM, [EMAIL PROTECTED] < > > > [EMAIL PROTECTED]> wrote: > > > > Hi, I literally copied-pasted some JS code from the developers guide > > > to insert an event on the users calendar but it's not working. I don't > > > know what I'm doing wrong. > > > > <script type="text/javascript" src="http://www.google.com/jsapi? > > > > key=ABQIAAAALFJ2c6HQGlU3drej7n5h_hToBR_vnWk6cftlfsPCwP5mfehuMBRK1GO3OV0oyIm8bU8IvTghC_Y6oQ > > > "></ > > > script> > > > <script type="text/javascript"> > > > > google.load('gdata', '1.s'); > > > google.setOnLoadCallback(getMyFeed); > > > > var feedUrl = "http://www.google.com/calendar/feeds/ > > > [EMAIL PROTECTED]/private/full"; > > > > function logMeIn() { > > > scope = "http://www.google.com/calendar/feeds/"; > > > var token = google.accounts.user.login(scope); > > > } > > > > function setupMyService() { > > > var myService = > > > new google.gdata.calendar.CalendarService('exampleCo- > > > exampleApp-1'); > > > logMeIn(); > > > return myService; > > > } > > > > function getMyFeed() { > > > myService = setupMyService(); > > > myService.getEventsFeed(feedUrl, handleMyFeed, > > > handleError); > > > } > > > > function handleMyFeed(myResultsFeedRoot) { > > > alert("This feed's title is: " + > > > myResultsFeedRoot.feed.getTitle().getText()); > > > insertIntoMyFeed(myResultsFeedRoot); > > > } > > > > function handleError(e) { > > > alert("There was an error!"); > > > alert(e.cause ? e.cause.statusText : e.message); > > > } > > > > function insertIntoMyFeed(feedRoot) { > > > var newEntry = new google.gdata.calendar.CalendarEventEntry({ > > > authors: [[] > > > { > > > name: "Elizabeth Bennet", > > > email: "[EMAIL PROTECTED]" > > > } > > > ], > > > title: {type: 'text', text: 'Tennis with Darcy'}, > > > content: {type: 'text', text: 'Meet for a quick lesson'}, > > > locations: [[] > > > { > > > rel: "g.event", > > > label: "Event location", > > > valueString: "Netherfield Park tennis court" > > > } > > > ], > > > times: [[] > > > { > > > startTime: > > > > google.gdata.DateTime.fromIso8601("2007-12-23T18:00:00.000Z"), > > > endTime: > > > > google.gdata.DateTime.fromIso8601("2007-12-23T19:00:00.000Z") > > > } > > > ] > > > } > > > ); > > > feedRoot.feed.insertEntry(newEntry, handleMyInsertedEntry, > > > handleError); > > > } > > > > function handleMyInsertedEntry(insertedEntryRoot) { > > > alert("Entry inserted. The title is: " + > > > insertedEntryRoot.entry.getTitle().getText()); > > > alert("The timestamp is: " + > > > insertedEntryRoot.entry.getTimes()[[]0].startTime); > > > } > > > > </script> > > > > Here's the webpage: > > > http://paginas.fe.up.pt/~ei00073/gcalendar/index.html<http://paginas.fe.up.pt/%7Eei00073/gcalendar/index.html> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Calendar Data API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-calendar-help-dataapi?hl=en -~----------~----~----~----~------~----~------~--~---
