| 95 | Access the Wiki with [http://www.jspwiki.org/Wiki.jsp?page=WikiRPCInterface2 WikiRPC] |
| 96 | {{{ |
| 97 | #!python |
| 98 | import xmlrpclib |
| 99 | |
| 100 | server = xmlrpclib.ServerProxy("http://athomas:password@localhost/trac-dev/login/xmlrpc") |
| 101 | |
| 102 | # print the content of WikiStart |
| 103 | print server.wiki.getPage("WikiStart") |
| 104 | |
| 105 | # print WikiStart as HTML |
| 106 | print server.wiki.getPageHTML("WikiStart") |
| 107 | |
| 108 | # write to the SandBox page from a text file |
| 109 | sandbox_content = file("sandbox.txt").read() |
| 110 | server.wiki.putPage("SandBox", sandbox_content, {"comments": "testing the WikiRPC interface"}) |
| 111 | }}} |
| 112 | |
| 113 | |