Peter Molnar github@petermolnar.net
Fri, 22 Feb 2019 10:57:47 +0000
1 files changed,
9 insertions(+),
2 deletions(-)
jump to
M
facebook2wordpress.py
→
facebook2wordpress.py
@@ -45,8 +45,8 @@ else:
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') )@@ -75,6 +75,13 @@ os.path.basename(media['uri']),
quote(fcontent), 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