Skip to content

Instantly share code, notes, and snippets.

View vivpuri's full-sized avatar

Vivek Puri vivpuri

View GitHub Profile
Traceback (most recent call last):
File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 511, in __call__
handler.get(*groups)
File "/base/data/home/apps/dir/version/folder/file.py", line 196, in get
self.redirect(blogger.GenerateOAuthAuthorizationURL())
File "/base/data/home/apps/dir/version/yql/../gdata/service.py", line 497, in GenerateOAuthAuthorizationURL
raise NonOAuthToken
NonOAuthToken
#Get request token
blogger = gdata.blogger.service.BloggerService(source=DOMAIN_NAME_COM)
blogger.SetOAuthInputParameters(gdata.auth.OAuthSignatureMethod.HMAC_SHA1,
GOOGLE_CONSUMER_KEY,
consumer_secret=GOOGLE_CONSUMER_SECRET)
gdata.alt.appengine.run_on_appengine(blogger)
request_token = blogger.FetchOAuthRequestToken( scopes='https://www.blogger.com/feeds/',
oauth_callback='http://www.example.com/bloggercb')
logging.info('request_token: %s' % request_token)
wrap = OAuthWrapHandler()
wrap.wrap_urls = lang.WINDOWSLIVE_WRAP_URLS
wrap.app_id = lang.WINDOWSLIVE_CONSUMER_KEY
wrap.app_secret = lang.WINDOWSLIVE_CONSUMER_SECRET
wrap.access_token = 'access_token'
wrap.refresh_code = 'refresh_code'
access_token = wrap.refresh_authorization_token()
url = 'http://apis.live.net/v4.0/'
headers = {'Authorization' : 'WRAP access_token=%s' % access_token, 'Accept': 'application/json', 'Content-Type': 'application/json' }
access_token = oauth.OAuthToken.from_string('oauth_token_secret=sec&oauth_token=tok')
consumer = OAuthConsumer(lang.TYPEPAD_CONSUMER_KEY, lang.TYPEPAD_CONSUMER_SECRET)
domain = urlparse.urlsplit(typepad.client.endpoint)[1]
typepad.client.add_credentials(consumer, access_token, domain=domain)
# Make sure the key works.
typepad.client.batch_request()
user = typepad.User.get_self()
typepad.client.complete_batch()
Traceback (most recent call last):
File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 511, in __call__
handler.get(*groups)
File "/base/data/home/apps/app/version/controller/file.py", line 302, in get
typepad.client.complete_batch()
File "/base/data/home/apps/app/version/yql/../batchhttp/client.py", line 623, in complete_batch
self.batchrequest.process(self, self.endpoint)
File "/base/data/home/apps/app/version/yql/../batchhttp/client.py", line 457, in process
self.handle_response(http, response, content)
File "/base/data/home/apps/app/version/yql/../batchhttp/client.py", line 514, in handle_response
headers = {'Authorization' : 'WRAP access_token=%s' % access_token, 'Accept': 'application/json', 'Content-Type': 'application/json' }
form_fields = {"StatusText" : "Working early today"}
form_data = urllib.urlencode(form_fields)
result = urlfetch.Fetch(url=urlStatusProfile, payload=form_data, headers=headers, method=urlfetch.PUT)
<?xml version="1.0" encoding="utf-8"?><error xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><code>412</code><message>Unauthorized request. Required offer not found</message></error>
url = 'http://api.typepad.com/api-keys/%s.json' % api.lang.TYPEPAD_CONSUMER_KEY
try:
result = urlfetch.fetch(url)
except Exception, e:
return
content = simplejson.loads(result.content)
if not content.has_key('owner'):
return
self.response.out.write(content)
owner = content['owner']
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 511, in __call__
handler.get(*groups)
File "/Users/user/Documents/folder/app/src/controller/file.py", line 180, in get
request_token = client.fetch_request_token(callback='http://www.example.com/callback')
File "/Users/user/Documents/folder/app/src/typepad/tpclient.py", line 276, in fetch_request_token
self.token),))
File "/Users/user/Documents/folder/app/src/oauth/oauth.py", line 619, in build_signature_base_string
key += escape(token.secret)
AttributeError: 'str' object has no attribute 'secret'