Show Page Source XML-RPC

A Python script that takes a url of a confluence page and prints the page source to std out.

The username/password is set to 'guest' which is specific to our install. it should work with empty string for anonymous but does not sseem to...
#!/usr/bin/python
#
#  given a url show the confluence page src
#  Zohar Melamed - 08/02/20005
#
#


from xmlrpclib import Server
import sys
import re


url = sys.argv[1]

terms = re.match('(?i)(^.*?)(?:/display/)(.*?)/(.*$)',url).groups();

server = terms[0]
space  = terms[1]
page   = terms[2].replace('+',' ')

s = Server(server + "/rpc/xmlrpc")

token = s.confluence1.login("guest","guest")

page = s.confluence1.getPage(token, space  , page )

print page["content"]

Labels

scripts scripts Delete
xml-rpc xml-rpc Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.