Commits

Anonymous committed 4d73bb0

Fix add method. title is opetion.

Comments (0)

Files changed (1)

readitlater/api.py

 class ServerError(ReadItLaterError): pass
 
 class API(object):
-    def __init__(self, api_key, username=None, password=None):
+    def __init__(self, api_key):
         self.__status = None
         self.api_key = api_key
 
     def __call(self, method, **params):
         params['apikey'] = self.api_key
+        params = dict([(k, v) for k, v in params.items() if v])
         try:
             res = urllib2.urlopen("%s%s?%s" % (
                 API_ENDPOINT, method, urllib.urlencode(params)))
         self.__call('auth', username=username, password=password)
         return True
 
-    def add(self, username, password, url, title):
+    def add(self, username, password, url, title=None):
         self.__call('add', username=username, password=password,
                 url=url, title=title)
         return True