def follow_user(self, user, delegate): """Follow the given user. Returns the user info back to the given delegate """ parser = txml.Users(delegate) return self.__postPage('/friendships/create/%s.xml' % (user, ), parser)
def report_spam(self, user_id, delegate): """Report an user for spam 'delegate' should a function that will get the user info returned by the API. Returns a deferred for the API call. """ parser = txml.Users(delegate) return self.__postPage('/report_spam.xml', parser, {'user_id': str(user_id)})
def show_user(self, user): """Get the info for a specific user. Returns a delegate that will receive the user in a callback.""" url = '/users/show/%s.xml' % (user, ) d = defer.Deferred() self.__downloadPage(url, txml.Users(lambda u: d.callback(u))) \ .addErrback(lambda e: d.errback(e)) return d
def verify_credentials(self, delegate=None): "Verify a user's credentials." parser = txml.Users(delegate) return self.__downloadPage('/account/verify_credentials.xml', parser)