(self, response)
Yield a simplified list of historical Whois records.
Yield a simplified list of historical Whois records.
Yield a simplified list of historical Whois records .
def recordlist_whoishistory(self, response):
        """Yield a simplified list of historical Whois records."""
        data = response.json()
        for record in data['response']['history']:
            emails = set(re.findall('[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}',record['record']))
            yield { 'date':  record['date'],
                    'registrant': record['whois'].get('registrant'),
                    'emails': ', '.join(emails),
                    'created': record.get('created'),
                   }
def recordlist_whoishistory ( self , response ) : data = response . json ( ) for record in data [ 'response' ] [ 'history' ] : emails = set ( re . findall ( '[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}' , record [ 'record' ] ) ) yield { 'date' : record [ 'date' ] , 'registrant' : record [ 'whois' ] . get ( 'registrant' ) , 'emails' : ', ' . join ( emails ) , 'created' : record . get ( 'created' ) , }