Beispiel #1
0
 def to_dict(self):
     '''Serializes to a dict with names matching delicious API'''
     return {
         'href' : self.href,
         'dt' : to_delicious_date_format(self.time),
         'description' : self.description,
         'extended' : self.extended,
         'hash' : hashlib.md5(self.href).hexdigest(),
         'meta' : self.meta,
         'tags' : ' '.join(self.tags)
     }
Beispiel #2
0
    def get(self):
        '''Returns the last update time for the user, as well as the number of new items
        in the user’s inbox since it was last visited.
        
        Use this before calling posts/all to see if the data has changed since the last fetch.
        '''

        update = {
            'code' : '200',
            'inboxnew' : '0', # not implemented
            'message' : 'success',
            'time' : to_delicious_date_format(datetime.now())
            }

        self.write_xml(results('update', [], update))