using databases and sql while trueacct input('enter twitter accountor quit'if (acct ='quit')break if (len(acct )cur execute('select name from twitter where retrieved limit 'tryacct cur fetchone()[ exceptprint('no unretrieved twitter accounts found'continue url twurl augment(twitter_url{'screen_name'acct'count'' '}print('retrieving'urlconnection urlopen(urlcontext=ctxdata connection read(decode(headers dict(connection getheaders()print('remaining'headers[' -rate-limit-remaining']js json loads(datadebugging print json dumps(jsindent= cur execute('update twitter set retrieved= where name ?'(acct)countnew countold for in js['users']friend ['screen_name'print(friendcur execute('select friends from twitter where name limit '(friend)trycount cur fetchone()[ cur execute('update twitter set friends where name ?'(count+ friend)countold countold exceptcur execute('''insert into twitter (nameretrievedfriendsvalues (? )'''(friend)countnew countnew print('new accounts='countnewrevisited='countoldconn commit(cur close(codeour database is stored in the file spider sqlite and it has one table named twitter each row in the twitter table has column for the account namewhether we have retrieved the friends of this accountand how many times this account has been "friended