gdata-api

TypeError when trying to upload Pictures from Google App Engine to Picasa with the GData API

别等时光非礼了梦想. 提交于 2019-12-06 04:26:17
I'm trying to write a small tool to upload Pictures from Google App Engine to Picasa. Fetching the image works, but when i try to upload it i get the error " TypeError: stat() argument 1 must be (encoded string without NULL bytes), not str " The Code basically looks like this: def getfile(url): result = urlfetch.fetch(url) if result.status_code == 200: return (result.content) logging.error ("[-] Error fetching URL: %s" % url) def uploadpicture(comment,pic): album_url = '/data/feed/api/user/%s/album/%s' % (username, album) fname = "image.jpg" entry = gd_client.InsertPhotoSimple(album_url, fname

youtube python api gdata.service. requesterror

亡梦爱人 提交于 2019-12-06 04:21:20
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

Google Spreadsheet API: memory exceeded

吃可爱长大的小学妹 提交于 2019-12-05 22:41:53
Don't know if anyone has experience with the Google Spreadsheets API or the Zend_GData classes but it's worth a go: When I try to insert a value in a 750 row spreadsheet, it takes ages and then throws an error that my memory limit (which is 128 MB!) was exceeded. I also got this when querying all records of this spreadsheet but this I can imaging because it's quite a lot of data. But why does this happen when inserting a row? That's not too complex, is it? Here's the code I used: public function insertIntoSpreadsheet($username, $password, $spreadSheetId, $data = array()) { $service = Zend

gdata youtube query problem

醉酒当歌 提交于 2019-12-05 21:03:50
i have asked this question before but no answer was there. so asking again. I just cant figure out which gdata framework class to use so that i can search youtube videos . i used some classes by debugging code but i think the framework is so deep that it can take a lot of time to figure out this problem . so please help me . i have a search box in my app and i want that after entering any keyword(s) in that search box and tapping the search button i should get the proper response . i tried some code but always it returns the same result. here is my code... -(void)searchYoutube { NSString

Google's Oauth for Installed apps vs. Oauth for Web Apps

人盡茶涼 提交于 2019-12-05 09:22:43
So I'm having trouble understanding something... If you do Oauth for Web Apps, you register your site with a callback URL and get a unique consumer secret key. But once you've obtained an Oauth for Web Apps token, you don't have to generate Oauth calls to the google server from your registered domain. I regularly use my key and token from scripts running via an apache server at localhost on my laptop and Google never says "you're not sending this request from the registered domain." It just sends me the data. Now, as I understand it, if you do Oauth for Installed Apps, you use "anonymous"

Getting Zend_GData Feed for a Specific Google Calendar

北城余情 提交于 2019-12-05 08:52:35
I had a long detailed question about how to get a specific calendar's event feed, but figured (I think) a solution out before I posted. However, even with the solution I'm left wondering what I'm missing about this process. To get a single calendar's event feed (or to search that feed) I do the following: Authenticate (obviously) Get a list of Calendars: getCalendarListFeed(); Get the id property from one of the 'calendar' objects Change: .../calendar/feeds/default/XXX%40YYY To: .../calendar/feeds/XXX%40YYY/private/full Pass that to getCalendarEventFeed() to query for that calendar. Why do I

Google Calendar feed api deleted events

我是研究僧i 提交于 2019-12-05 08:50:22
I'm syncing the Google Calendar with my application (I store events in a database). When an event is updated I can easily find the last updates by sorting the event feed on the 'updated' order. However, if an event is removed / deleted, how can I track this update from the feed? Try to add showdeleted=true to your query feed and then check for EventStatus.CANCELED on retrieved entries. Check this thread for further information. I did exactly the thing you want to do (see this post: http://code.pui.ch/2009/12/29/fetch-publicly-available-google-calendar-data-with-python/ ): I have a database

Retrieving contacts with gdata.contacts.client and oauth2

随声附和 提交于 2019-12-05 07:21:18
问题 I am using oAuth2WebServerFlow to get an oAuth access token and then retrieve a list of a user's contacts. I'm using web2py as the web framework. flow = oauth2client.client.OAuth2WebServerFlow(client_id=CLIENT_ID, client_secret=CLIENT_SECRET, scope='https://www.google.com/m8/feeds', user_agent=USER_AGENT) callback = 'http://127.0.0.1:8000/Test/searcher/oauth2callback' authorise_url = flow.step1_get_authorize_url(callback) session.flow = pickle.dumps(flow) redirect(authorise_url) With the

Google calendar query returns at most 25 entries

最后都变了- 提交于 2019-12-05 01:02:22
问题 I'm trying to delete all calendar entries from today forward. I run a query then call getEntries() on the query result. getEntries() always returns 25 entries (or less if there are fewer than 25 entries on the calendar). Why aren't all the entries returned? I'm expecting about 80 entries. As a test, I tried running the query, deleting the 25 entries returned, running the query again, deleting again, etc. This works, but there must be a better way. Below is the Java code that only runs the

How to upload documents with new python-gdata (2.0.16)?

这一生的挚爱 提交于 2019-12-04 19:23:48
With python-gdata 2.0.14, I used the following pieces of code to create and upload documents: # To create a document import gdata.docs import gdata.docs.client from gdata.data import MediaSource gdClient = gdata.docs.client.DocsClient(source="my-app") gdClient.ssl = True gdClient.ClientLogin("login", "pa$$word", gdClient.source) ms = MediaSource(file_path="temp.html", content_type="text/html") entry = gdClient.Upload(ms, "document title") print "uploaded, url is", entry.GetAlternateLink().href and # To update a document entry.title.text = "updated title" entry = gdClient.Update(entry, media