all repos — facebook2wordpress.py @ 5d947bf90c39645e13bb52acdaa9f60551a94670


        
Peter Molnar github@petermolnar.net
Fri, 22 Feb 2019 10:57:47 +0000
commit

5d947bf90c39645e13bb52acdaa9f60551a94670

parent

c185dbb07507c250aec73abfcf8bb90f11fa5781

1 files changed, 9 insertions(+), 2 deletions(-)

jump to
M facebook2wordpress.pyfacebook2wordpress.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