using databases and sql so the first time the program runs and we enter twitter accountthe program runs as followsenter twitter accountor quitdrchuck retrieving new accounts revisited enter twitter accountor quitquit since this is the first time we have run the programthe database is empty and we create the database in the file spider sqlite and add table named twitter to the database then we retrieve some friends and add them all to the database since the database is empty at this pointwe might want to write simple database dumper to take look at what is in our spider sqlite fileimport sqlite conn sqlite connect('spider sqlite'cur conn cursor(cur execute('select from twitter'count for row in curprint(rowcount count print(count'rows 'cur close(codethis program simply opens the database and selects all of the columns of all of the rows in the table twitterthen loops through the rows and prints out each row if we run this program after the first execution of our twitter spider aboveits output will be as follows('opencontent' ('lhawthorn' ('steve_coppin' ('davidkocher' ('hrheingold' rows we see one row for each screen_namethat we have not retrieved the data for that screen_nameand everyone in the database has one friend now our database reflects the retrieval of the friends of our first twitter account (drchuckwe can run the program again and tell it to retrieve the friends of the next "unprocessedaccount by simply pressing enter instead of twitter account as follows