first last

PHP Post to Blogger

I use PHP for Esotropiart's server-side scripting, plus a MySQL database. I hand code everything simply because I enjoy knowing what's really going on. I also need this new knowledge to help me be useful in the competitive web design industry.

Last night I was trying to figure out if it is possible to post to my Blogger mirror using PHP. The reason being, of course, I could write a blog entry for Esotropiart, and the PHP script would auto-magically send the information to Blogger and create an identical post there. This would save me the step of cut & paste junkerons. Plus, the posting times would more closely match, rather than one being significantly after the other due to the time it takes to copy and post.

Of more interest to me would be the ability to define a specific post time. If you use Bloggers forms and interface, it uses the current time and date to associate with the post. I want to mirror all my old Esotropiart EsoBlog entries on the Blogger account, and I want to retain their past dates. If I reposted them on Blogger, they would have current dates and appear more recent than truly new posts instead of being in the archives.

By reading Blogger's Atom API documentation, I found out it is indeed possible to write a function to create a post using PHP (among most other desirable functions like changing a post or deleting a post). However, finding documentation to help me fully understand and implement the script was very hard to find. In fact, of the two supposed reputable tutorials on the subject (one linked to Blogger's help section), neither was successful in creating a post. At this point, I think I may have to have access to a Secure Sockets Layer (SSL) library. Since I don't have administrator privileges with my hosting service, I have no control whether or not they have this feature installed. I don't believe they do. So I continue in my inability to post to Blogger with PHP. Boo hoo!

first last