From 5d947bf90c39645e13bb52acdaa9f60551a94670 Mon Sep 17 00:00:00 2001 From: Peter Molnar Date: Fri, 22 Feb 2019 10:57:47 +0000 Subject: [PATCH] --- facebook2wordpress.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/facebook2wordpress.py b/facebook2wordpress.py index 9e5a1dd..15bdd2a 100644 --- a/facebook2wordpress.py +++ b/facebook2wordpress.py @@ -45,8 +45,8 @@ for c, post in enumerate(data): t = 'gallery' - cmd = "post_id=$(wp post create --porcelain --post_category='Facebook' --post_date='%s' --post_content=%s --post_title='%s')" % ( - str(dt), + cmd = "post_id=$(wp-cli post create --porcelain --post_category='Facebook' --post_date='%s' --post_content=%s --post_title='%s')" % ( + dt.format('YYYY-MM-DD HH:mm:ss'), quote(content), dt.format('YYYY-MM-DD HH:mm') ) @@ -76,6 +76,13 @@ for c, post in enumerate(data): f )) + out.append("wp-cli post update ${post_id} --post_content=%s --post_status='publish' --post_author='4'" % ( + quote("%s\n\n[gallery]" % content) + )) + out.append("wp-cli post update ${post_id} --post_date='%s'" % ( + dt.format('YYYY-MM-DD HH:mm:ss') + )) + if len(out) == 1: continue else: