コード例 #1
0
ファイル: happyfoto-cz.py プロジェクト: nijel/photo-uploader
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
'''

import phoupl
import phoupl.happyfoto

class HappyFotoCZService(phoupl.core.PhotoUploader, phoupl.happyfoto.HappyFoto):
    def _connect(self):
        phoupl.happyfoto.HappyFoto.__init__(self, 'happyfoto.cz', 4)
        phoupl.happyfoto.HappyFoto._connect(self)

    def _upload(self, image):
        phoupl.happyfoto.HappyFoto._upload(self, image)

    def get_review_url(self):
        return phoupl.happyfoto.HappyFoto.get_review_url(self)

# Register service
phoupl.register_service(
        'happyfoto.cz',
        HappyFotoCZService,
        'http://happyfoto.cz/',
        ['new'],
        'Happy Foto.cz',
        ['cz'],
        ['cze']
        )
コード例 #2
0
ファイル: postimg.py プロジェクト: nijel/photo-uploader
        m = MATCHER_DELETELINK.search(data)
        self._delete_urls.append(m.group(1))

    def _post_upload(self):
        self.msg(
            """
You can link image as:
%s
You can display image here:
%s
You can delete image here:
%s
"""
            % ("\n".join(self._img_urls), "\n".join(self._show_urls), "\n".join(self._delete_urls))
        )

    def get_review_url(self):
        return self._show_urls


# Register service
phoupl.register_service(
    "postimage.org",
    PostImageService,
    "http://postimage.org/",
    ["new"],
    "PostImage",
    languages=["eng"],
    servicetype="storage",
)
コード例 #3
0
ファイル: imageshack.py プロジェクト: nijel/photo-uploader
                    ('email', ''),
                    ('public', 'yes' if self._config.getbool('imageshack.us', 'public') else 'no'),
                    ('key', 'SYKFZ21G9186be76287f58e42c6f5ef47b992697'),
                    ('cookie', self._config.get('imageshack.us', 'regcode')),
                ])
        response = json.load(self._buffer)
        self._img_urls.append(response["links"]["image_link"])
        self._show_urls.append(response["links"]["is_link"])

    def _post_upload(self):
        self.msg('''
You can link image as:
%s
You can display image here:
%s
''' % ('\n'.join(self._img_urls), '\n'.join(self._show_urls)))

    def get_review_url(self):
        return self._show_urls

# Register service
phoupl.register_service(
        'imageshack.us',
        ImageShackService,
        'http://imageshack.us/',
        ['new'],
        'ImageShack',
        languages = ['eng'],
        servicetype = 'storage'
        )