From: Toni T. <tti...@us...> - 2004-12-15 00:30:32
|
On Tue, Dec 14, 2004 at 12:01:56AM -0500, Ross M Karchner wrote: > Great work on getting WP to work on Postgres-- Thank you! Thanks. Actually I just happen to be one that has made a debian package for the wordpress-pg and hanging around in this mailing list, not the original developer. >=20 > I was wondering if someone on the list could point me to what needs to > be fixed to get the metaWeblog.getRecentPosts XML-RPC call to work.=20 > I'm hoping it's just a matter of tweaking a query written for MySQL. Sure. >=20 > Here is a trace of the XML-RPC transaction (sorry-- it's long): > Great work on getting WP to work on Postgres-- Thank you! > > [A long output, deleted] Ok, I don't know which version of xmlrpc/wordpress you happen to use here. There is no xmlrpc.php in the 1.2.1 version, but I managed to generate similar error messages by using (debianized) wordpress-pg-1.2.1+1.0-2 and including xmlrpc.php from earlier packaging wordpress-1.2.0-1.1 (available from http://ftp.debian.org/debian/pool/main/w/wordpress/ or directly from http://ftp.debian.org/debian/pool/main/w/wordpress/wordpress_1.2.0.orig.tar= =2Egz ) Here is a patch against it to make the metaWeblog.getRecentPosts work. diff -ub xmlrpc.php /usr/share/wordpress/xmlrpc.php --- xmlrpc.php 2004-05-22 01:17:51.000000000 +0300 +++ /usr/share/wordpress/xmlrpc.php 2004-12-15 02:06:02.000000000 +0200 @@ -1554,10 +1554,10 @@ =20 $post =3D get_extended($entry['post_content']); =20 - $postid =3D new xmlrpcval($entry['ID']); + $postid =3D new xmlrpcval($entry['id']); $title =3D new xmlrpcval(stripslashes($entry['post_title'])); $description =3D new xmlrpcval(stripslashes($post['main'])); - $link =3D new xmlrpcval(post_permalink($entry['ID'])); + $link =3D new xmlrpcval(post_permalink($entry['id'])); $permalink =3D $link; =20 $extended =3D new xmlrpcval(stripslashes($post['extended'])); ---------------- A sample usage/test session: toni@mario:~/source/wp$ python Python 2.3.4 (#2, Dec 3 2004, 13:53:17)=20 [GCC 3.3.5 (Debian 1:3.3.5-2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import xmlrpclib >>> server =3D xmlrpclib.Server("http://localhost/blog/xmlrpc.php") >>> server.metaWeblog.getRecentPosts("0","*****","*****",5) [{'permalink': 'http://mario.datanet/blog/index.php?m=3D200411#post-2', 'de= scription': 'joo..', 'title': 'Hmm..', 'mt_excerpt': '', 'userid': '1', 'da= teCreated': <DateTime u'20041130T16:20:20' at 403decec>, 'link': 'http://ma= rio.datanet/blog/index.php?m=3D200411#post-2', 'mt_text_more': '', 'mt_allo= w_comments': 1, 'postid': '2', 'categories': [''], 'mt_allow_pings': 1}, {'= permalink': 'http://mario.datanet/blog/index.php?m=3D200411#post-1', 'descr= iption': 'Welcome to WordPress. This is the first post. Edit or delete it, = then start blogging!', 'title': 'Hello world!', 'mt_excerpt': '', 'userid':= '1', 'dateCreated': <DateTime u'20041129T00:22:06' at 403fc52c>, 'link': '= http://mario.datanet/blog/index.php?m=3D200411#post-1', 'mt_text_more': '',= 'mt_allow_comments': 1, 'postid': '1', 'categories': ['General'], 'mt_allo= w_pings': 1}] >>>=20 toni@mario:~/source/wp$ Seems to work fine now. --=20 Toni Timonen "toni dot timonen at iki dot fi" NP Solutions Ltd Helsinki University of Technology Department of Engineering Physics and Mathematics |