Hello,

Here's the patch to use the updated API. Also I've requested an API key
for you (you should have received an email from them also).

-- 
WBR, Andrew
From: Andrew Shadura <bugzi...@tut.by>
Subject: Update photo-uploader to the new API. Also require user to specify a registration code.

diff --git a/usr/share/pyshared/phoupl/services/imageshack.py b/usr/share/pyshared/phoupl/services/imageshack.py
--- a/usr/share/pyshared/phoupl/services/imageshack.py
+++ b/usr/share/pyshared/phoupl/services/imageshack.py
@@ -39,17 +39,18 @@
 
     def _upload(self, image):
         self._curl.setopt(pycurl.HTTPHEADER, ['Expect:'])
-        self.post('http://imageshack.us/',
+        self.post('http://imageshack.us/upload_api.php',
                 [
                     ('fileupload', (pycurl.FORM_FILE, image)),
                     ('uploadtype', 'on'),
                     ('refer', 'http://www.imageshack.us/'),
                     ('brand', ''),
                     ('email', ''),
+                    ('key', 'SYKFZ21G9186be76287f58e42c6f5ef47b992697'),
                     ('MAX_FILE_SIZE', '13145728'),
                     ('optsize', '320x320'),
-                    ('url', 'paste image url here'),
-
+                    ('a_username', self._config.get('imageshack.us', 'user')),
+                    ('cookie', self._config.get('imageshack.us', 'regcode')),
                 ])
         data = self._buffer.getvalue()
         m = MATCHER_TAG.search(data)

Attachment: signature.asc
Description: PGP signature

Reply via email to