Subversion Repositories SmartDukaan

Rev

Rev 1786 | Rev 1789 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1786 Rev 1787
Line 299... Line 299...
299
  for i in range(0, MAX_PAGE):
299
  for i in range(0, MAX_PAGE):
300
    result = search_page(i, ENGINE_URL)
300
    result = search_page(i, ENGINE_URL)
301
    if result != 0:
301
    if result != 0:
302
      break
302
      break
303
 
303
 
304
  f = open('/var/lib/tomcat6/webapps/db/googleranks/rank.txt', 'a')
304
  f = open('/var/lib/tomcat6/webapps/db/googleranks/rank-' + datetime.datetime.now().strftime("%Y-%m-%d") + '.txt', 'a')
305
 
305
 
306
  # show results
306
  # show results
307
  if result == 0:
307
  if result == 0:
308
    f.write("{0:s}, {1:s}, {2:d}, {3:d}".format(datetime.datetime.now().strftime("%Y-%m-%d %H:%M"), search_string, NUM_PER_PAGE*MAX_PAGE, MAX_PAGE*NUM_PER_PAGE/10))
308
    f.write("{0:s}, {1:s}, {2:d}, {3:d}\n".format(datetime.datetime.now().strftime("%Y-%m-%d %H:%M"), search_string, NUM_PER_PAGE*MAX_PAGE, MAX_PAGE*NUM_PER_PAGE/10))
309
  else:
309
  else:
310
    f.write("{0:s}, {1:s}, {2:d}, {3:d}".format(datetime.datetime.now().strftime("%Y-%m-%d %H:%M"), search_string, result, result/10 + 1))
310
    f.write("{0:s}, {1:s}, {2:d}, {3:d}\n".format(datetime.datetime.now().strftime("%Y-%m-%d %H:%M"), search_string, result, result/10 + 1))
311
 
311
 
312
 
312
 
313
# Run Main
313
# Run Main
314
main()
314
main()