summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--artima/general/what-i-am-doing.txt (renamed from artima/what-i-am-doing.txt)0
-rw-r--r--artima/post.py15
2 files changed, 14 insertions, 1 deletions
diff --git a/artima/what-i-am-doing.txt b/artima/general/what-i-am-doing.txt
index 7fea6e7..7fea6e7 100644
--- a/artima/what-i-am-doing.txt
+++ b/artima/general/what-i-am-doing.txt
diff --git a/artima/post.py b/artima/post.py
index b8a5d71..1248316 100644
--- a/artima/post.py
+++ b/artima/post.py
@@ -23,5 +23,18 @@ if __name__ == '__main__':
c.formvalue('1', 'password', 'pippolippo')
c.submit()
c.go('http://www.artima.com/weblogs/editpost.jsp?thread=%s' % thread)
- c.formvalue('1', 'body', text)
+ try:
+ c.formvalue('1', 'body', text)
+ except:
+ print "Saving the offending post on /tmp/x.txt ..."
+ file('/tmp/x.txt', 'w').write(text)
+ raise
c.submit()
+
+"""
+from ms.http_utils import urlopen2
+urlopen2('http://www.artima.com/sign_in?d=%2Findex.jsp',
+ dict(username='micheles', password='pippolippo'))
+urlopen2('http://www.artima.com/weblogs/editpost.jsp',
+ dict(thread='261364', body='prova'))
+"""