0

I'm trying to publish posts via xmlrpc lib with Python. The problem is in post status: it setted to "publish in future" but should to be "published". Here is a part of my code:

status_draft = 0
status_published = 1
server = xmlrpclib.ServerProxy(wp_url)
title = titles.encode("utf-8")
content = text.encode("utf-8")
date_created = xmlrpclib.DateTime(datetime.datetime.today())
categories = ["News"]
tags = []
data = {'title': title, 'description': content, 'dateCreated': date_created, 'categories': categories, 'mt_keywords': tags}
post_id = server.metaWeblog.newPost(wp_blogid, wp_username, wp_password, data, status_published)

WP version is 3.5.1, Python 2.7

How can I solve this problem ?

Siamak Motlagh
  • 5,028
  • 7
  • 41
  • 65
Valery Statichny
  • 593
  • 7
  • 22
  • Are the system time of the client and the server set correctly? Is the date_created of the post really in the past, relative to the system time of the server? – Daniel Hepper Mar 12 '13 at 14:12
  • Thanks, I'd find out that the prblem was truely in dateCreated. The way to solve that issue is to set date_created time minus random time value. – Valery Statichny Jun 14 '13 at 15:10

1 Answers1

0

I find out that the prblem was truely in dateCreated. The way to solve that issue is to set date_created time minus random time value.

Valery Statichny
  • 593
  • 7
  • 22