예제 #1
0
class ClearbitDomainTest(unittest.TestCase):

    def testCompanyDomain(self):
        self.clearbitApi = Clearbit(storage=DictionaryStorage())
        domain = u'www.versature.com'
        result = self.clearbitApi.company_search(domain)
        self.assertIsNotNone(result)
예제 #2
0
class ClearbitCompany(CherryPicker):

    def __init__(self, source=None, storage=None, request_handler=None):
        super(ClearbitCompany, self).__init__(source, storage, request_handler)
        if not source:
            self.source = Clearbit(storage=storage, request_handler=request_handler)

    def __call__(self, howdy_model, force=False):
        result = self.source.company_search(howdy_model['domain'], force)
        self.parse_result(result, howdy_model)

    def parse_result(self, result, howdy_model):
        howdy_model['description'] = result.get('description', None)
        howdy_model['twitter'] = result.get('twitter', None)
        howdy_model['linkedin'] = result.get('linkedin', None)
        howdy_model['facebook'] = result.get('facebook', None)
        howdy_model['employees'] = result.get('employees', None)
        howdy_model['logo'] = result.get('logo', None)
예제 #3
0
 def __init__(self, source=None, storage=None, request_handler=None):
     super(ClearbitCompany, self).__init__(source, storage, request_handler)
     if not source:
         self.source = Clearbit(storage=storage, request_handler=request_handler)