2012-10-19 | Paul Boddie | file changeset files shortlog | Moved decryption and verification support into MoinMessage. Introduced a GPG class to hold common configuration information and provide a more natural programming interface. Added a setup script. |
paul@0 | 1 | #!/usr/bin/env python |
paul@0 | 2 | |
paul@0 | 3 | import httplib |
paul@0 | 4 | import sys |
paul@0 | 5 | |
paul@0 | 6 | if __name__ == "__main__": |
paul@0 | 7 | host = sys.argv[1] |
paul@0 | 8 | path = sys.argv[2] + "?action=PostMessage" |
paul@0 | 9 | |
paul@5 | 10 | text = sys.stdin.read() |
paul@0 | 11 | |
paul@0 | 12 | req = httplib.HTTPConnection(host) |
paul@0 | 13 | req.request("PUT", path, text) # {"Content-Length" : len(text)} |
paul@0 | 14 | resp = req.getresponse() |
paul@0 | 15 | print resp.read() |
paul@0 | 16 | |
paul@0 | 17 | # vim: tabstop=4 expandtab shiftwidth=4 |