mirror of
https://github.com/timberjoegithub/GoogleScrape.git
synced 2026-07-22 00:19:48 +00:00
Had some string compares against ints
This commit is contained in:
@@ -1028,7 +1028,7 @@ def post_to_wp(title, content, headers,date, rating,address, picslist):
|
|||||||
#countreview = False
|
#countreview = False
|
||||||
addresshtml = re.sub(" ", ".",address)
|
addresshtml = re.sub(" ", ".",address)
|
||||||
googleadress = r"<a href=https://www.google.com/maps/dir/?api=1&destination="+\
|
googleadress = r"<a href=https://www.google.com/maps/dir/?api=1&destination="+\
|
||||||
addresshtml + r">"+address+r"</a>"
|
addresshtml + r">"+str(address)+r"</a>"
|
||||||
contentpics = ''
|
contentpics = ''
|
||||||
picl = picslist[1:-1]
|
picl = picslist[1:-1]
|
||||||
pic2 = picl.replace(",","")#re.sub(r',','',picl) #re.sub( r'[^a-zA-Z0-9]','',tempdate[1])
|
pic2 = picl.replace(",","")#re.sub(r',','',picl) #re.sub( r'[^a-zA-Z0-9]','',tempdate[1])
|
||||||
@@ -1154,7 +1154,7 @@ def post_to_wp(title, content, headers,date, rating,address, picslist):
|
|||||||
file_id, link = check_media(picname, headers)
|
file_id, link = check_media(picname, headers)
|
||||||
# link = linknew['rendered']
|
# link = linknew['rendered']
|
||||||
if file_id is False:
|
if file_id is False:
|
||||||
print (' '+picname+' was not already found in library, adding it')
|
print (' '+str(picname)+' was not already found in library, adding it')
|
||||||
# countreview = True
|
# countreview = True
|
||||||
image = {
|
image = {
|
||||||
"file": open(pic, "rb"),
|
"file": open(pic, "rb"),
|
||||||
@@ -1191,7 +1191,7 @@ def post_to_wp(title, content, headers,date, rating,address, picslist):
|
|||||||
headers=headers, data={"post" : post_id},timeout=30)
|
headers=headers, data={"post" : post_id},timeout=30)
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
print (' Error- Image ',picname,' was not attached to post. response: ',\
|
print (' Error- Image ',picname,' was not attached to post. response: ',\
|
||||||
image_response+' '+error)
|
image_response+' '+type(error).__name__)
|
||||||
try:
|
try:
|
||||||
post_response = requests.post(env.wpAPI + "/posts/" + str(post_id),\
|
post_response = requests.post(env.wpAPI + "/posts/" + str(post_id),\
|
||||||
headers=headers,timeout=30)
|
headers=headers,timeout=30)
|
||||||
|
|||||||
Reference in New Issue
Block a user