mirror of
https://github.com/timberjoegithub/GoogleScrape.git
synced 2026-07-22 00:19:48 +00:00
fixed twitter
This commit is contained in:
@@ -469,7 +469,7 @@ def get_google_data(driver,outputs ):
|
|||||||
database_update_row(name,"googleurl",googleurl,"onlyempty",outputs)
|
database_update_row(name,"googleurl",googleurl,"onlyempty",outputs)
|
||||||
database_update_row(name,"place_id",place_id,"onlyempty",outputs)
|
database_update_row(name,"place_id",place_id,"onlyempty",outputs)
|
||||||
database_update_row(name,"googledetails",details,"onlyempty",outputs)
|
database_update_row(name,"googledetails",details,"onlyempty",outputs)
|
||||||
database_update_row(name,"google","1","onlyempty",outputs)
|
database_update_row(name,"google",True,"onlyempty",outputs)
|
||||||
except KeyError as error:
|
except KeyError as error:
|
||||||
print('Error writing business details from google maps : ',error)
|
print('Error writing business details from google maps : ',error)
|
||||||
else:
|
else:
|
||||||
@@ -852,18 +852,19 @@ def post_to_x2(title, content, date, rating, address, picslist, instasession,out
|
|||||||
# Message to post along with the video
|
# Message to post along with the video
|
||||||
attrib_list = outputs['postssession'].query(Posts).filter(Posts.name == title).all()
|
attrib_list = outputs['postssession'].query(Posts).filter(Posts.name == title).all()
|
||||||
business_url = attrib_list[0].businessurl
|
business_url = attrib_list[0].businessurl
|
||||||
wpurl = attrib_list[0].wpurl
|
if business_url:
|
||||||
status_message = str(title) + ': My Review - '+ wpurl + '\n Business website: '+ \
|
wpurl = attrib_list[0].wpurl
|
||||||
business_url
|
status_message = str(title) + ': My Review - '+ wpurl + '\n Business website: '+ \
|
||||||
status_message2 = status_message +' '+str(get_hastags(address, title, 'short'))+' '
|
business_url
|
||||||
status_message_short = status_message2[:279]
|
status_message2 = status_message +' '+str(get_hastags(address, title, 'short'))+' '
|
||||||
# Upload video
|
status_message_short = status_message2[:279]
|
||||||
media = client_v1.media_upload(filename=video_path)
|
# Upload video
|
||||||
# Post tweet with video
|
media = client_v1.media_upload(filename=video_path)
|
||||||
if media.processing_info['state'] != 'failed':
|
# Post tweet with video
|
||||||
client_v2.create_tweet(text=status_message_short, media_ids=[media.media_id])
|
if media.processing_info['state'] != 'failed':
|
||||||
else:
|
client_v2.create_tweet(text=status_message_short, media_ids=[media.media_id])
|
||||||
print ('Problem uploading video to twitter: ',media.processing_info['error'])
|
else:
|
||||||
|
print ('Problem uploading video to twitter: ',media.processing_info['error'])
|
||||||
except AttributeError as error:
|
except AttributeError as error:
|
||||||
print("AttributeError An error occurred:",error) # An error occurred:
|
print("AttributeError An error occurred:",error) # An error occurred:
|
||||||
time.sleep(env.facebooksleep)
|
time.sleep(env.facebooksleep)
|
||||||
@@ -1393,11 +1394,12 @@ def process_reviews(outputs):
|
|||||||
if env.web :
|
if env.web :
|
||||||
#if writtento["web"] == 0 :
|
#if writtento["web"] == 0 :
|
||||||
try:
|
try:
|
||||||
post_id, post_link = get_wordpress_post_id_and_link(processrow[1].value,outputs['web'] )
|
if env.forcegoogleupdate:
|
||||||
if post_link:
|
post_id, post_link = get_wordpress_post_id_and_link(processrow[1].value,outputs['web'] )
|
||||||
database_update_row(processrow[1].value,"wpurl",post_link,"forceall",outputs)
|
if post_link:
|
||||||
else:
|
database_update_row(processrow[1].value,"wpurl",post_link,"forceall",outputs)
|
||||||
print (' Error getting wordpress links to update databse')
|
else:
|
||||||
|
print (' Error getting wordpress links to update databse')
|
||||||
except AttributeError as error :
|
except AttributeError as error :
|
||||||
print ('Could not check to see post already exists',error)
|
print ('Could not check to see post already exists',error)
|
||||||
if outputs['postssession'].query(Posts).filter(Posts.name == processrow[1].\
|
if outputs['postssession'].query(Posts).filter(Posts.name == processrow[1].\
|
||||||
|
|||||||
Reference in New Issue
Block a user