alexjamesbrown / JoeBlogs

Wordpress / Metaweblog API Wrapper
53 stars 40 forks source link

Schedule posting not working #7

Open tareq07 opened 12 years ago

tareq07 commented 12 years ago

I need create schedule post option my application. When i add DateCreate option it create schedule post but my every post is missed schedule. Is there any other option for schedule post?

Thanks Tareq

bikeoid commented 9 years ago

Does your post ever eventually appear if you leave it for {ExpectedPostTime + TimeZone + ServerDelta} hours?

I have been wrestling with this for a while and finally got the Wordpress admin to add wp-crontrol so that I could see what was happening. I found that a scheduled post does not appear at the time shown on the post schedule - it's as though the WordPress time stamp is considered as local time instead of UTC. I think there was also some sort of UTC <> Local time mismatch when scheduling a post. I made a few changes, and it's now working but I don't know which change helped most.

  1. Add post_status field to the Metaweblog Post record, with a value of "future"

    1. Change JoeBlogs.Post DateCreated type to CookComputing.XmlRpc.XmlRpcDateTime type ( I think that is not required)
    2. Change CookComputing.XmlRpc Serialize() date serializer to string sdt = dt.ToString("yyyyMMdd'T'HH':'mm':'ss'Z'", DateTimeFormatInfo.InvariantInfo);

    (That adds a Z suffix, which I read as mandatory by ISO8601)