Search Results

Search found 742 results on 30 pages for 'gdata'.

Page 1/30 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to move a google doc into a folder using Zend Gdata

    - by Andre
    Hi Guys I am really struggling with moving a document from my root folder to another folder using zend gdata here is how i am trying to do it, but its not working. $service = Zend_Gdata_Docs::AUTH_SERVICE_NAME; $client = Zend_Gdata_ClientLogin::getHttpClient($gUser, $gPass, $service); $link = "https://docs.google.com/feeds/documents/private/full/spreadsheet:0AUFNVEpLOVg2U0E"; // Not real id for privacy purposes $docs = new Zend_GData_Docs($client); // Attach a category object of folder to this entry // I have tried many variations of this including attaching label categories $cat = new Zend_Gdata_App_Extension_Category('My Folder Name','http://schemas.google.com/docs/2007#folder'); $entry = $docs->getDocumentListEntry($link); $entry->setCategory(array($cat)); $return = $docs->updateEntry($entry,$entry->getEditLink()->href); When I run this I get No errors, but nothing seems to change, and the return data does not contain the new category. EDIT: Ok I realised that its not the category but the link that decides which "collection" (folder) a resource belongs too. https://developers.google.com/google-apps/documents-list/#managing_collections_and_their_contents says that each resource has as et of parent links, so I tried changing my code to do set link instead of set category, but this did not work. $folder = "https://docs.google.com/feeds/documents/private/full/folder%3A0wSFA2WHc"; $rel = "http://schemas.google.com/docs/2007#parent"; $linkObj = new Zend_Gdata_App_Extension_Link($folder,$rel,'application/atom+xml', NULL,'Folder Name'); $links = $entry->getLink(); array_push($links,$linkObj); $entry->setLink($links); $return = $docs->updateEntry($entry,$entry->getEditLink()->href); EDIT: SOLVED [nearly] OK Here is how to move/copy, sort of, from one folder to another: simpler than initially thought, but problem is it creates a reference and NOT a move! It now in both places at the same time.... // Folder you wnat to move too $folder = "https://docs.google.com/feeds/folders/private/full/folder%asdsad"; $data = $docs->insertDocument($entry, $folder); // Entry is the entry you want moved using insert automatically assigns link & category for you...

    Read the article

  • [Gdata] GetAuthSubToken returns None

    - by Matt
    Hey guys, I am a little lost on how to get the auth token. Here is the code I am using on the return from authorizing my app: client = gdata.service.GDataService() gdata.alt.appengine.run_on_appengine(client) sessionToken = gdata.auth.extract_auth_sub_token_from_url(self.request.uri) client.UpgradeToSessionToken(sessionToken) logging.info(client.GetAuthSubToken()) what gets logged is "None" so that does seem right :-( if I use this: temp = client.upgrade_to_session_token(sessionToken) logging.info(dump(temp)) I get this: {'scopes': ['http://www.google.com/calendar/feeds/'], 'auth_header': 'AuthSub token=CNKe7drpFRDzp8uVARjD-s-wAg'} so I can see that I am getting a AuthSub Token and I guess I could just parse that and grab the token but that doesn't seem like the way things should work. If I try to use AuthSubTokenInfo I get this: Traceback (most recent call last): File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/__init__.py", line 507, in __call__ handler.get(*groups) File "controllers/indexController.py", line 47, in get logging.info(client.AuthSubTokenInfo()) File "/Users/matthusby/Dropbox/appengine/projects/FBCal/gdata/service.py", line 938, in AuthSubTokenInfo token = self.token_store.find_token(scopes[0]) TypeError: 'NoneType' object is unsubscriptable so it looks like my token_store is not getting filled in correctly, is that something I should be doing? Also I am using gdata 2.0.9 Thanks Matt

    Read the article

  • Blogger GData NullPointerException on every second try on Android

    - by Vinay
    I am experiencing a strange phenomenon with Blogger GData API 2.0 on Android. I am using the BloggerService to retrieve blogs. First time it works fine. However EVERY SECOND TRY I get a NullPointerException: Caused by: java.lang.NullPointerException at com.google.gdata.wireformats.AltRegistry.lookupType(AltRegistry.java:190) at com.google.gdata.client.Service.parseResponseData(Service.java:1860) at com.google.gdata.client.Service.getFeed(Service.java:1054) at com.google.gdata.client.Service.getFeed(Service.java:916) at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:631) at com.google.gdata.client.Service.getFeed(Service.java:935)

    Read the article

  • youtube python api gdata.service. requesterror

    - by nashr rafeeg
    i have the following code which is trying to add a set of videos into a youtube play list import urllib,re import gdata.youtube import gdata.youtube.service class reddit(): def __init__(self, rssurl ='http://www.reddit.com/r/chillmusic.rss' ): self.URL = rssurl self._downloadrss() def _downloadrss(self): if self.URL.endswith('.rss'): # Downloadd the RSS feed of the subreddit - save as "feed.rss" try: print "Downloading rss from reddit..." urllib.urlretrieve (URL, "feed.rss") except Exception as e: print e def clean(self): playList = open("feed.rss").read() links = re.findall(r'(http?://www.youtube.com\S+)', playList) for link in links: firstPass = link.replace('">[link]</a>', '') secondPass = firstPass.replace('&fmt=18', '') thirdpass = secondPass.replace('&feature=related', '') finalPass = thirdpass.replace('http://www.youtube.com/watch?v=', '') print thirdpass, "\t Extracted: ", finalPass return finalPass class google(): def __init__(self, username, password): self.Username = username self.password = password #do not change any of the following self.key = 'AI39si5DDjGYhG_1W-8n_amjgEjbOU27sa0aw2RQI5gOaoK5KqCD2Fzffbkh8oqGu7CqFQLLQ7N7wK0gz7lrTQbd70srC72Niw' self.appname = 'Reddit playlist maker' self.service = gdata.youtube.service.YouTubeService() def authenticate(self): self.service.email = self.Username self.service.password = self.password self.service.developer_key = self.key self.service.client_id = self.appname self.service.source = self.appname self.service.ssl = False self.service.ProgrammaticLogin() def get_playlists(self): y_playlist = self.service.GetYouTubePlaylistFeed(username='default') l = [] k = [] for p in y_playlist.entry: k=[] k=[p.link[1].href, p.title.text] l.append(k) return l def get_playlist_id_from_url(self, href): #quick and dirty method to get the playList id's return href.replace('http://www.youtube.com/view_play_list?p=','') def creat_playlist(self, name="Reddit list", disc ="videos from reddit"): playlistentry = self.service.AddPlaylist(name, disc) if isinstance(playlistentry, gdata.youtube.YouTubePlaylistEntry): print 'New playlist added' return playlistentry.link[1].href def add_video_to_playlist(self,playlist_uri,video): video_entry = self.service.AddPlaylistVideoEntryToPlaylist( playlist_uri, video) if isinstance(video_entry, gdata.youtube.YouTubePlaylistVideoEntry): print 'Video added' URL = "http://www.reddit.com/r/chillmusic.rss" r = reddit(URL) g = google('[email protected]', 'xxxx') g.authenticate() def search_playlist(playlist="Reddit list3"): pl_id = None for pl in g.get_playlists(): if pl[1] == playlist: pl_id = pl[0] print pl_id break if pl_id == None: pl_id = g.creat_playlist(name=playlist) return pl_id pls = search_playlist() for video_id in r.clean(): g.add_video_to_playlist(pls, video_id) when i run the code i am geting the following error message gdata.service.RequestError: {'status': 303, 'body': '', 'reason': 'See Other'} any one have any idea why i am getting this error cheers Nash

    Read the article

  • Problems with GData Request Token

    - by Dan Delgado
    We have successfully used GData libraries to access a user's Google Docs. But we encountered problems when many users log in to our site and authorize our web app at the same time or successively. Here's what happens: First user successful logs in, authorizes our web app via OAuth and is able to add rubric (or google spreadsheet). Second user, immediately after first user adds a rubric, successfully logs in then webapp fails on authorize (Token not given. I tried to log it.) Third user fails on login. Fourth user was able to log in, authorize via OAuth, and create rubrics successfully. Fifth user was able to log in but like the second user, gets an invalid token on authorize (Token not given.) And the list goes on. Results were unpredicatable. Below is an excerpt of the stack trace we get when the fail scenario happens: Nested in org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException: java.lang.NullPointerException at com.google.gdata.client.authn.oauth.OAuthUtil.normalizeParameters(OAuthUtil.java:158) at com.google.gdata.client.authn.oauth.OAuthUtil.getSignatureBaseString(OAuthUtil.java:81) at com.google.gdata.client.authn.oauth.OAuthHelper.addCommonRequestParameters(OAuthHelper.java:649) at com.google.gdata.client.authn.oauth.OAuthHelper.getOAuthUrl(OAuthHelper.java:592) at com.google.gdata.client.authn.oauth.OAuthHelper.getUnauthorizedRequestToken(OAuthHelper.java:276) at com.projectrix.controller.OAuthController.authorize(OAuthController.java:59) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Method.java:40) Help!

    Read the article

  • GData for my own API?

    - by Malax
    Hi StackOverflow! Im currently planning to build an API for my service. I want to use GData because it fits the application scheme and there are libraries for many programming languages available. The first question that rose: Am I allowed to do that? I mean, Google put lots of work into the GData specification and have some sort of copyright. Does anyone know anything about this issue or did that before? You could extend the case if you want to specifically mimic an API which uses GData like the YouTube API to have my API 100% compliant. This is not my case, but I was wondering about that too. :-) Thank you for any input, Malax Edit: Note that i want to use it for my own service. So, I am implementing an API using the GData protocol, not using one of the Google APIs.

    Read the article

  • How to upload video to favorite/playlist using gdata in objective c

    - by Swati
    hi, i am trying to upload a video to favorite in my account but it shows Invalid request Uri and status code =400 i dont understand how should i format my request my code NSURL *url = [NSURL URLWithString: http://gdata.youtube.com/feeds/api/users/username/favorite]; ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; [request setPostValue:@"gdata.youtube.com" forKey:@"Host"]; [request setPostValue:@"application/atom+xml" forKey:@"Content-Type"]; [request setPostValue:@"CONTENT_LENGTH" forKey:@"Content-Length"]; [request setPostValue:@"" forKey:@"AuthSubToken"]; [request setPostValue:@"2" forKey:@"GData-Version"]; [request setPostValue:developer_key forKey:@"X-GData-Key"]; [request setPostValue:xml_data forKey:@"API_XML_Request"]; [request setDelegate:self]; [request setDidFailSelector:@selector(requestFailed:)]; [request setDidFinishSelector:@selector(gotTheResponse:)]; [[networkQueue go]; i have auth token and developer key, VIDEO_ID.but m not sure how to pass xml data in post request: <?xml version="1.0" encoding="UTF-8"?> <entry xmlns="http://www.w3.org/2005/Atom"> <id>VIDEO_ID</id> </entry> NSString *xml_data = contains xml data in string form

    Read the article

  • Gwt-gdata authentication

    - by Raffo
    Hi guys, I'm writing an application with GWT and I found on the internet that there's a library to use easily gdata features. In particular I need to use the integration with Google Calendar. I followed the official guide on gwt-gdata site to do the authentication ( http://code.google.com/p/gwt-gdata/wiki/GettingStarted ) but unfortunately, I got an error. This is the error: 17:59:12.463 [ERROR] [testmappa] Unable to load module entry point class testMappa.client.TestMappa (see associated exception for details) com.google.gwt.core.client.JavaScriptException: (TypeError): $wnd.google.accounts is undefined fileName: http://127.0.0.1:8888 lineNumber: 29 stack: ("http://www.google.com/calendar/feeds/")@http://127.0.0.1:8888:29 connect("http://127.0.0.1:8888/TestMappa.html?gwt.codesvr=127.0.0.1:9997","`gL1<a3s4B&Y{(Ci","127.0.0.1:9997","testmappa","2.0")@:0 ((void 0),"testmappa","http://127.0.0.1:8888/testmappa/")@http://127.0.0.1:8888/testmappa/hosted.html?testmappa:264 z()@http://127.0.0.1:8888/testmappa/testmappa.nocache.js:2 (-2)@http://127.0.0.1:8888/testmappa/testmappa.nocache.js:8 at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:195) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.google.gwt.accounts.client.User.login(User.java) at testMappa.client.TestMappa.onModuleLoad(TestMappa.java:68) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:369) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:185) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:380) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222) at java.lang.Thread.run(Thread.java:637) I'm not able to understand the reason of this error. My code is simply: String scope = "http://www.google.com/calendar/feeds/"; User.login(scope); And as far as I know it should work as it is. I don't know what to do and I'm here to ask how to solve this problem and if I can directly use gdata native java library, but I believe this other thing is not possible to be done for client-side gwt code (since the code is going to be converted to javascript). Thank you.

    Read the article

  • Simple question in ClientLogin using python gdata library

    Hi friends, I have incorporated ClientLogin into my python application to retrieve contact list of the user , I like to know how to get the name of the user who has logged in.My code to get the names from the contact list of the user is as given below gd_client = gdata.contacts.service.ContactsService() gd_client.email = yemail gd_client.password = ypass gd_client.source = 'GoogleInc-ContactsPythonSample-1' gd_client.ProgrammaticLogin() query = gdata.contacts.service.ContactsQuery() query.max_results=150 feed = gd_client.GetContactsFeed(query.ToUri()) for i, entry in enumerate(feed.entry): #print '\n%s %s' % (ctr+i+1, entry.title.text) na=entry.title.text names.append(na) Please help me to know how to get the name of the user who has logged in Thanks ganesh

    Read the article

  • SyntaxError using gdata-python-client to access Google Book Search Data API

    - by isbadawi
    >>> import gdata.books.service >>> service = gdata.books.service.BookService() >>> results = service.search_by_keyword(isbn='0434003484') Traceback (most recent call last): File "<pyshell#4>", line 1, in <module> results = service.search_by_keyword(isbn='0434003484') ... snip ... File "C:\Python26\lib\site-packages\atom\__init__.py", line 127, in CreateClassFromXMLString tree = ElementTree.fromstring(xml_string) File "<string>", line 85, in XML SyntaxError: syntax error: line 1, column 0 This is a minimal example -- in particular, the book service unit tests included in the package also fail with the exact same error. I've looked at the wiki and open issue tickets on Google Code to no avail (and this seems to me more apt to be a silly error on my end rather than a problem with the library). I'm not sure how to interpret the error message. If it matters, I'm using python 2.6.5.

    Read the article

  • zend gdata google base getting link url and parsing xml with object oriented php

    - by thrice801
    Hi, So I am using Zend frameworks Gdata extension to parse xml data from google base. http://framework.zend.com/manual/en/zend.gdata.gbase.html Working fine minus one damn important thing I cant seem to parse, the link to the actual page, because there are two elements and its returned as an array. Anyways Ive tried vardumping the array but what comes out didnt help me figure out what was going on any better. So heres the specifics of the issue. echo $entry->title->text."<br />".$entry->id->text."<br />".$entry->content->text."<br />".$entry->author[0]->name."<br />"; (the above code works fine). Now according to the documentation I thought I could get the link href by going $entry-link-text or $entry-link-url (tried both, neither worked). Anyways, Im not sure whether this is zend specific or just a gap in my OOP understanding, but any help would be much appreciated!

    Read the article

  • Using Gdata Calendar API for PHP App to create a calender system with event ownership

    - by linuxlover101
    Hello, I'm working on a PHP app, and I'm trying to find the best way to set up a calendar system. First let me describe the intended function of the system: The application has multiple users who can login simultaneously. Each user should be able to add their own events and display them on their "profile." Also, on another page, the events should be able to be shown all together (from all users) and from each individual users exclusively. Since Google Calendar has a nice calendar-looking interface, I thought I would work with the GData APIs. Originally, I thought this would make things easier. But then it seems that if I want to represent event ownership, either each user would have to have a google account or somehow they all would each have to have a separate calendar. Thus, the application would have to create the calendar (if it does not exist) and be able to edit only their calendar. Two questions: Can I somehow use the GData APIs to accomplish my goal? (Mainly event ownership.) Should I just create my own calendar like application? Thanks!

    Read the article

  • Getting Error "Namespace Name "Contacts" Does Not Exists" in spite of using using "Google.GData.C

    - by Pari
    I want to create Contact on Google Apps. I am Using this API And referring this link In below code i am using "Using Google.GData.Contacts" : using Google.GData.Contacts; // Using Google.GData.Contacts using Google.GData.Client; using Google.GData.Extensions; using Google.Contacts; // at this place i am getting error Error: The type or namespace name 'Contacts' does not exist in the namespace 'Google' (are you missing an assembly reference?) I have included Google.GData.Contacts API. But still it is giving Error. Can anyone tell me why this is happening? m i missing any Assembly reference? I want to use: Contact newContact = new Contact(); newContact.Title.Text = "Liz Doe"; "Contact" does not exist in Either "Google.GData.Contacts" or "Google.GData". Is there any other way to use it?

    Read the article

  • Using GData and the Google Analytics on Android

    - by Luke Lowrey
    I am wondering what my options are for using GData and specifically the analytics api on android to build a small widget. After searching around for a while I couldnt come up with any libraries with decent examples. Are there any dedicated libraries with some decent examples / doco to do this sort of thing? I would like to target 1.6 but if the are 2.0 only I guess that is fine too.

    Read the article

  • Reading a document's content from the gdata API?

    - by user246114
    Hi, I'm using the java library to access the gdata api. I just want to be able to print the contents of a document. I setup my project to list all the docs in my feed, now that I have a document listing, I want to print its contents: for (DocumentListEntry entry : feed.getEntries()) { // Ok, how do we print the doc's contents now? entry.getContents(); } It looks like we're supposed to get the URL from the entry, then read the contents at the URL ourselves. I found a post stating that this is how we get that URL: MediaContent content = (MediaContent)entry.getContent(); String url = content.getUri(); but when I try to read from it, I get an html response saying 'this content has moved'. I read that this is because we have to authenticate our http-read method, but I'm not sure how to do that. Is there really no built-in way to do this? Thanks

    Read the article

  • gdata api + javascript library for accessing documents?

    - by user246114
    Hi, I wanted to do the following with the gdata javascript library: get a list of a user's documents. read the contents of a chosen document. edit its contents, update the document. If I'm reading correctly, this is not supported by the javascript library? I got this to work with the java library, but would like to push this functionality to the client. Is it possible? If not, are there any ways around it? Thank you

    Read the article

  • gdata youtube api 302 'The document has moved'

    - by zalew
    I'm trying to get YouTube feeds with the python gdata library. Authentication features work ok, yt_service.ProgrammaticLogin() works, generating subauth token works, etc., but when I try to get some feeds (GetMostRecentVideoFeed, GetYouTubeVideoEntry, even GetFeed, and any other) I get: RequestError: {'status': 302, 'body': '<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">\n<TITLE>302 Moved</TITLE></HEAD><BODY>\n<H1>302 Moved</H1>\nThe document has moved\n<A HREF="http://www.google.com">here</A>.\r\n</BODY></HTML>\r\n', 'reason': 'Redirect received, but redirects_remaining <= 0'} 302 to 'google.com'??? I've even tried to do something from the google online tutorials and I get the same error. What's going on?

    Read the article

  • Ask for an example code for parsing xml and get attributes by using GData API

    - by ben
    When i use GData API in my app for parsing xml,how could i get attributes and it's value? Wanted a piece of example code.Thanks a lot. xml: <playurls><url islive="0" type="3" bit_stream="1">http://vods.netitv.com//dy2/2010/02/08/cf584b76-3579-4b75-a0c8-f7a473d79f8c.mp4 </url><url islive="0" type="3" bit_stream="2">http://vods.netitv.com//dy/2010/02/08/965bbc65-8ec0-4c50-98ae-c69a831926cc.mp4 </url><url islive="0" type="2" bit_stream="1">http://vods.netitv.com//dy2/2010/02/08/cf584b76-3579-4b75-a0c8-f7a473d79f8c.mp4 </url><url islive="0" type="2" bit_stream="2">http://vods.netitv.com//dy/2010/02/08/965bbc65-8ec0-4c50-98ae-c69a831926cc.mp4 </url></playurls>

    Read the article

  • GData API works in Android 2.0 SDK & up?

    - by user266361
    I used GData API to pull in Calender info. It works fine if I use 1.6. But the same code, if I change to Android 2.0 & up, it would throw AuthenticationException. Below is my code for ur ref: CalendarService myService = new CalendarService("My Application"); myService.setUserCredentials(args[0],args[1]); // Set up the URL and the object that will handle the connection: URL feedUrl = new URL("http://www.google.com/calendar/feeds/"+args[0]+"/private/full"); args[0] & args[1] are the credentials. AuthenticationException will be thrown when calling myService.setUserCredentials(). Anybody has any clue?

    Read the article

  • Forbidden Not authorized to access this feed

    - by user302593
    Hai, I want to create a sites by using java programming. but it contain error like this... Exception in thread "main" com.google.gdata.util.ServiceForbiddenException: Forbidden Not authorized to access this feed at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:561) at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:563) at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:536) at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:515) at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:535) at com.google.gdata.client.Service.getFeed(Service.java:1073) at com.google.gdata.client.Service.getFeed(Service.java:936) at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:631) at com.google.gdata.client.Service.getFeed(Service.java:955) at lsites.getSiteFeed(lsites.java:25) at lsites.main(lsites.java:40) what i want to do? Regards, Bhuvana

    Read the article

  • How to upload video on YouTube with Ruby

    - by viatropos
    I am trying to upload a youtube video using the GData gem (I have seen the youtube_g gem but would like to make it work with pure GData if possible), but I keep getting this error: GData::Client::BadRequestError in 'MyProject::Google::YouTube should upload the actual video to youtube (once it does, mock this test out)' request error 400: No file found in upload request. I am using this code: def metadata data = <<-EOF <?xml version="1.0"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007"> <media:group> <media:title type="plain">Bad Wedding Toast</media:title> <media:description type="plain"> I gave a bad toast at my friend's wedding. </media:description> <media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">People</media:category> <media:keywords>toast, wedding</media:keywords> </media:group> </entry> EOF end @yt = GData::Client::YouTube.new @yt.clientlogin("name", "pass") @yt.developer_key = "myKey" url = "http://uploads.gdata.youtube.com/feeds/api/users/name/uploads" mime_type = "multipart/related" file_path = "sample_upload.mp4" @yt.post_file(url, file_path, mime_type, metadata) What is the recommended/standard way for uploading videos to youtube with ruby, what is your method? Update After applying the changes to wrapped_entry, the string it produces looks like this: --END_OF_PART_59003 Content-Type: application/atom+xml; charset=UTF-8 <?xml version="1.0"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007"> <media:group> <media:title type="plain">Bad Wedding Toast</media:title> <media:description type="plain"> I gave a bad toast at my friend's wedding. </media:description> <media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">People</media:category> <media:keywords>toast, wedding</media:keywords> </media:group> </entry> --END_OF_PART_59003 Content-Type: multipart/related Content-Transfer-Encoding: binary ... and inspecting the request and response looks like this: Request: <GData::HTTP::Request:0x1b8bb44 @method=:post @url="http://uploads.gdata.youtube.com/feeds/api/users/lancejpollard/uploads" @body=#<GData::HTTP::MimeBody:0x1b8c738 @parts=[#<GData::HTTP::MimeBodyString:0x1b8c058 @bytes_read=0 @string="--END_OF_PART_30909\r\nContent-Type: application/atom+xml; charset=UTF-8\r\n\r\n <?xml version=\"1.0\"?>\n<entry xmlns=\"http://www.w3.org/2005/Atom\"\n xmlns:media=\"http://search.yahoo.com/mrss/\"\n xmlns:yt=\"http://gdata.youtube.com/schemas/2007\">\n <media:group>\n <media:title type=\"plain\">Bad Wedding Toast</media:title>\n <media:description type=\"plain\">\n I gave a bad toast at my friend's wedding.\n </media:description>\n <media:category scheme=\"http://gdata.youtube.com/schemas/2007/categories.cat\">People</media:category>\n <media:keywords>toast wedding</media:keywords>\n </media:group>\n</entry> \n\r\n--END_OF_PART_30909\r\nContent-Type: multipart/related\r\nContent-Transfer-Encoding: binary\r\n\r\n"> #<File:/Users/Lance/Documents/Development/git/thing/spec/fixtures/sample_upload.mp4> #<GData::HTTP::MimeBodyString:0x1b8c044 @bytes_read=0 @string="\r\n--END_OF_PART_30909--"] @current_part=0 @boundary="END_OF_PART_30909" @headers={"Slug"="sample_upload.mp4" "User-Agent"="GoogleDataRubyUtil-AnonymousApp" "GData-Version"="2" "X-GData-Key"="key=AI39si7jkhs_ECjF4unOQz8gpWGSKXgq0KJpm8wywkvBSw4s8oJd5p5vkpvURHBNh-hiYJtoKwQqSfot7KoCkeCE32rNcZqMxA" "Content-Type"="multipart/related; boundary=\"END_OF_PART_30909\"" "MIME-Version"="1.0"} Response: #<GData::HTTP::Response:0x1b897e0 @body="No file found in upload request." @headers={"cache-control"=>"no-cache no-store must-revalidate" "connection"=>"close" "expires"=>"Fri 01 Jan 1990 00:00:00 GMT" "content-type"=>"text/plain; charset=utf-8" "date"=>"Fri 11 Dec 2009 02:10:25 GMT" "server"=>"Upload Server Built on Nov 30 2009 13:21:18 (1259616078)" "x-xss-protection"=>"0" "content-length"=>"32" "pragma"=>"no-cache"} @status_code=400> Still not working, I'll have to check it out more with those changes.

    Read the article

  • PHP DOM vs SimpleXML for Atom GData feed parsing

    - by Geoff Adams
    I'm building a library to access the Google Analytics Data Export API. All the data the library accesses is in Atom format and utilises numerous different namespaces throughout. My experiments with the API have used SimpleXML for parsing so far, especially as all I have been doing is accessing the data held within the feed. Now I'm coming to write a library I am wondering whether forging ahead with SimpleXML will be adequate or whether the enhanced functionality of the DOM module in PHP would be of benefit in the future. I haven't written much code for this part of the library yet so the choice is still open. I have read that the PHP DOM module can be a better choice if you need to build an XML DOM on the fly or modify an existing one, but I'm not entirely sure I would need that functionality anyway due to the nature of the API (no pushing data to the server, for instance). SimpleXML is certainly easier to use and I have seen people saying that for read-only situations it is all you need. Essentially the question is, what would you use? Compatibility will not be an issue as the server configuration will match the application's requirements. Is it worth building the library with PHP DOM in mind or should I stick with SimpleXML for now? Update: Here are two examples of the kind of feeds I will be dealing with: Account feed Data feed

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >