File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1515cursor .execute ('CREATE TABLE IF NOT EXISTS crawl_index ( url VARCHAR(256) PRIMARY KEY, title VARCHAR(256), keywords VARCHAR(256) )' )
1616cursor .execute ('CREATE TABLE IF NOT EXISTS queue ( url VARCHAR(256) PRIMARY KEY )' )
1717connection .commit ()
18+
19+ if len (argv ) < 2 :
20+ print "No starting point! Checking existing queue"
21+ cursor .execute ("SELECT * FROM queue LIMIT 1" )
22+ c = cursor .fetchone ()
23+ if c == None :
24+ sys .exit ("ERROR: No start point! Exiting" )
1825try :
19- cursor .execute ("INSERT INTO queue VALUES ( (?) )" , (sys .argv [1 ], ))
20- connection .commit ()
26+ if sys .argv [1 ]:
27+ cursor .execute ("INSERT INTO queue VALUES ( (?) )" , (sys .argv [1 ], ))
28+ connection .commit ()
2129except :
2230 pass
2331keywordregex = re .compile ('<meta\sname=["\' ]keywords["\' ]\scontent=["\' ](.*?)["\' ]\s/>' )
You can’t perform that action at this time.
0 commit comments