Пример #1
0
def request(api_id):
   ''' Helper formats request'''
   parameters = urllib.urlencode({'output': 'xml'})
   function = '%s%s?%s' % (access.URI_API, api_id, parameters)

   response = access.request(function)
   return response
Пример #2
0
def request(feed_id, count=20):
   ''' Helper formats request'''
   from repo.google.reader import access

   function = build_url(feed_id, count)
   response = access.request(function)

   return response
Пример #3
0
def request(api_id, data=None):
   ''' Helper formats request'''
   function = '%s%s' % (access.URI_API, api_id)
   if data is not None:
      #TODO: throw if username hasn't been set
      client_id = urllib.urlencode(dict(client=access.username()))
      data = urllib.urlencode(data)
      function = '%s?%s' % (function, client_id)

   response = access.request(function, data)
   return response