def verify_key(self): try: return fetch_url('http://rest.akismet.com/1.1/verify-key', { 'key': self.api_key, 'blog': self.blog_url }, 'POST') == 'valid' except: return False
def _make_call(self, action, comment, ip, author='', email='', user_agent=''): return fetch_url('http://%s.rest.akismet.com/1.1/%s' % (self.api_key, action), { 'comment_content': comment, 'comment_type': 'comment', 'comment_author': author, 'comment_author_email': email, 'user_agent': user_agent, 'user_ip': ip, 'blog': self.blog_url }, 'POST')