1234567891011121314151617181920212223242526272829303132333435363738 |
- # Test access to Wordpress
- #
- # Comment: Quite a usefull API to attach external scripts!!!
- #
- import sys
- from wordpress_xmlrpc import Client
- from wordpress_xmlrpc import WordPressPost, WordPressComment
- from wordpress_xmlrpc.methods.posts import GetPost
- # Access WP post
- # How to detector if it is available???
- # Use Wordpress account - not the mysql credentials
- # Todo: use scopus later !!!
- wp = Client('http://localhost/~kopmann/ufo2/xmlrpc.php', 'ufo', '$ipepdv$')
- wpid = 1149
- if len(sys.argv) > 1:
- wpid = int(sys.argv[1])
- # Read post
- try:
- post = wp.call(GetPost(wpid))
- print "Post %d: %s" %(wpid,post.title)
- except:
- print "Post %d seems to be not available" % wpid
|