Advertisement
Guest User

Untitled

a guest
Jun 20th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. DATABASE_HOST = "xxx"
  2. DATABASE_USER = "xxx"
  3. DATABASE_PASSWORD = "xx"
  4. DATABASE_NAME = "xxx"
  5.  
  6.  
  7.  
  8. def a(r):
  9.  
  10. db = MySQLdb.connect(DATABASE_HOST,DATABASE_USER,DATABASE_PASSWORD,DATABASE_NAME,charset='utf8',use_unicode=True)
  11.  
  12. cursor1 = db.cursor()
  13.  
  14.  
  15. print domain
  16. search = "***"
  17. res_f = cursor1.execute(search)
  18. data = cursor1.fetchone()
  19. data = str(data)
  20. data2 = data
  21. '''to do'''
  22.  
  23. db.close()
  24.  
  25.  
  26.  
  27.  
  28. def data_base(increment_count):
  29.  
  30. db = MySQLdb.connect(DATABASE_HOST,DATABASE_USER,DATABASE_PASSWORD,DATABASE_NAME,charset='utf8',use_unicode=True)
  31.  
  32. cursor1 = db.cursor()
  33.  
  34. search = "***"
  35.  
  36. res1 = cursor1.execute(search)
  37.  
  38. res2_1 = cursor1.fetchall()
  39.  
  40.  
  41. get_urls1(res2_1)
  42.  
  43. increment_count = increment_count + 1
  44. return increment_count
  45.  
  46.  
  47. def get_urls1(res2):
  48. for r in res2:
  49. a(r)
  50. print "Final Update Completed"
  51.  
  52. localtime = time.asctime( time.localtime(time.time()) )
  53. print localtime
  54.  
  55.  
  56. if __name__ == '__main__':
  57. increment_count = 0
  58. while increment_count < 1000000:
  59. increment_count = data_base(increment_count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement