mirror of
https://github.com/timberjoegithub/GoogleScrape.git
synced 2026-07-22 00:19:48 +00:00
working on wpurl, need to clean DB, got dup records
This commit is contained in:
@@ -660,7 +660,7 @@ def get_wordpress_post_id_and_link(postname,headers2):
|
||||
result = response.json()
|
||||
if len(result) > 0 :
|
||||
post_id = int(result[0]['id'])
|
||||
post_date = result[0]['date']
|
||||
# post_date = result[0]['date']
|
||||
post_link = result[0]['link']
|
||||
return post_id, post_link
|
||||
else:
|
||||
@@ -1249,7 +1249,7 @@ def process_reviews(outputs):
|
||||
new_web_post=post_to_wordpress(processrow[1].value,processrow[2].\
|
||||
value,outputs['web'] ,processrow[7].value, processrow[3].value\
|
||||
, processrow[8].value, processrow[5].value,outputs)
|
||||
print (' Success Posting to Wordpress: '+processrow[1].value)# ',processrow[1].value, processrow[2].value, headers,processrow[7].value, processrow[3].value,processrow[8].value, processrow[5].value, temp3["web"] )
|
||||
print (' Success Posting to Wordpress: '+processrow[1].value)
|
||||
if new_web_post:
|
||||
webcount +=1
|
||||
try:
|
||||
@@ -1257,20 +1257,17 @@ def process_reviews(outputs):
|
||||
outputs['datawb'].save(env.xls)
|
||||
print(' Successfully updated spreadsheet')
|
||||
except Exception as error:
|
||||
print(" An error occurred writing Excel file:", type(error).__name__) # An error occurred: try:
|
||||
print(" An error occurred writing Excel file:", type(error).__name__)
|
||||
try:
|
||||
print(' write to DB for web')
|
||||
outputs['postssession'].query(Posts).filter(Posts.name == processrow[1].value).update({"web" : 1})
|
||||
outputs['postssession'].commit()
|
||||
print(' Successfully wrote to database')
|
||||
except Exception as error:
|
||||
print(" An error occurred writing database", type(error).__name__) # An error occurred:
|
||||
print(" An error occurred writing database", type(error).__name__)
|
||||
except Exception as error:
|
||||
print (' Error writing web post : ',processrow[1].value, processrow[2].value,processrow[7].value, processrow[3].value,processrow[8].value, processrow[5].value, writtento["web"])
|
||||
print (error) #print (' Error writing web post : ',processrow[1].value, processrow[2].value, outputs['web'],processrow[7].value, processrow[3].value,processrow[8].value, processrow[5].value, writtento["web"] )
|
||||
print (' Error writing web post : ',processrow[1].value, processrow[2].value,processrow[7].value, processrow[3].value,processrow[8].value, processrow[5].value, writtento["web"],' ',error)
|
||||
print (error)
|
||||
#print (' Error writing web post : ',processrow[1].value, processrow[2].value, outputs['web'],processrow[7].value, processrow[3].value,processrow[8].value, processrow[5].value, writtento["web"] )
|
||||
else:
|
||||
print (' Exceeded the number of web posts per run, skipping', processrow[1].value)
|
||||
else:
|
||||
@@ -1287,7 +1284,7 @@ def process_reviews(outputs):
|
||||
processrow[9].value = str(writtento)
|
||||
except Exception as error:
|
||||
print(" An error occurred setting value to go into Excel file:", type(error).__name__)
|
||||
print (' Success Posting to Instagram: '+processrow[1].value)# ',processrow[1].value, processrow[2].value, headers,processrow[7].value, processrow[3].value,processrow[8].value, processrow[5].value, temp3["web"] )
|
||||
print (' Success Posting to Instagram: '+processrow[1].value)
|
||||
if NewInstagramPost:
|
||||
instagramcount +=1
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user