Subversion Repositories SmartDukaan

Rev

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

Rev 2082 Rev 2083
Line 19... Line 19...
19
# USER_AGENT = 'Mozilla/5.0'
19
# USER_AGENT = 'Mozilla/5.0'
20
FIND_DOMAIN = 'www.saholic.com'
20
FIND_DOMAIN = 'www.saholic.com'
21
LOCALE = '.co.in'
21
LOCALE = '.co.in'
22
MAX_PAGE = 10
22
MAX_PAGE = 10
23
NUM_PER_PAGE = 100
23
NUM_PER_PAGE = 100
24
SEARCH_STRING_MAX_SLEEP = 60 #seconds
24
SEARCH_STRING_MAX_SLEEP = 120 #seconds
25
PAGE_MAX_SLEEP = 10 #seconds
25
PAGE_MAX_SLEEP = 20 #seconds
26
DB_HOST = "localhost"
26
DB_HOST = "localhost"
27
DB_USER = "root"
27
DB_USER = "root"
28
DB_PASSWORD = "shop2020"
28
DB_PASSWORD = "shop2020"
29
DB_NAME = "serp"
29
DB_NAME = "serp"
30
 
30
 
Line 65... Line 65...
65
    return rankRequest
65
    return rankRequest
66
 
66
 
67
  def start(self):
67
  def start(self):
68
    for search_string in self.searchStrings:
68
    for search_string in self.searchStrings:
69
      if len(self.results) >= 30:
69
      if len(self.results) >= 30:
70
        time.sleep(random.randint(60*5, 60*15)) # sleep for 2 to 10 min after 20 queries
70
        time.sleep(random.randint(60*5, 60*15)) # sleep for 5 to 15 min after 20 queries
71
        if self.db_mode:
71
        if self.db_mode:
72
          self.pushResultsToDb()
72
          self.pushResultsToDb()
73
      self.find_google_position(search_string)
73
      self.find_google_position(search_string)
74
      if self.db_mode:
74
      if self.db_mode:
75
        time.sleep(random.randint(0, self.searchStringMaxSleep))
75
        time.sleep(random.randint(0, self.searchStringMaxSleep))