Ronio Jerico Roque commited on
Commit
b91bf72
·
1 Parent(s): eed4ab5

Fix MongoDB collection reference in Seo class and clean up process method

Browse files
Files changed (1) hide show
  1. classes/response_seo.py +3 -4
classes/response_seo.py CHANGED
@@ -58,7 +58,7 @@ class Seo:
58
  mongodb_uri = os.getenv("MONGODB_URI")
59
  myclient = MongoClient(mongodb_uri)
60
  mydb = myclient.get_database()
61
- mycol = mydb["df_data"]
62
  x = mycol.find_one({"data_field": data_field})
63
  x = x["result"]
64
  return x
@@ -149,7 +149,6 @@ class Seo:
149
 
150
  def process (self):
151
  with st.spinner('Seo Analyst...', show_time=True):
152
- print("doneeeeeeeeeee")
153
  st.write('')
154
  headers = {"Content-Type": "application/json", "x-api-key": f"{os.getenv('x_api_key')}"}
155
  try:
@@ -175,7 +174,6 @@ class Seo:
175
  self.payload = ""
176
  self.payload += self.fetch_data("SEO Keywords")
177
 
178
-
179
  self.payload += self.fetch_data("Traffic Channels")
180
 
181
  self.payload += self.fetch_data("Traffic Acquisition")
@@ -183,7 +181,8 @@ class Seo:
183
 
184
  self.payload += self.fetch_data("Pages Indexed")
185
 
186
- self.payload += self.fetch_data("Bounce Rate")
 
187
  self.payload += self.fetch_backlinks("Backlinks")
188
 
189
  summary = self.fetch_data("Client Summary")
 
58
  mongodb_uri = os.getenv("MONGODB_URI")
59
  myclient = MongoClient(mongodb_uri)
60
  mydb = myclient.get_database()
61
+ mycol = mydb["df_data"]['question']
62
  x = mycol.find_one({"data_field": data_field})
63
  x = x["result"]
64
  return x
 
149
 
150
  def process (self):
151
  with st.spinner('Seo Analyst...', show_time=True):
 
152
  st.write('')
153
  headers = {"Content-Type": "application/json", "x-api-key": f"{os.getenv('x_api_key')}"}
154
  try:
 
174
  self.payload = ""
175
  self.payload += self.fetch_data("SEO Keywords")
176
 
 
177
  self.payload += self.fetch_data("Traffic Channels")
178
 
179
  self.payload += self.fetch_data("Traffic Acquisition")
 
181
 
182
  self.payload += self.fetch_data("Pages Indexed")
183
 
184
+ self.payload += self.fetch_data("Bounce Rate")
185
+
186
  self.payload += self.fetch_backlinks("Backlinks")
187
 
188
  summary = self.fetch_data("Client Summary")