Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close

Overview

imagepaste is a command-line utility on Haskell for sending images to image-hosting sites.

Features

imagepaste supports image pasting sites as follows:

  • fastpic.ru
  • rghost.ru
  • radikal.ru
  • ipicture.ru
  • ompldr.org
  • imp.flashtux.org
  • imagebin.com
  • imm.io
  • scrin.org
  • uploadscreenshot.com
  • imgur.com

Building

Building is quite simple. You will need ghc and cabal to build imagepaste. Also, make sure you already have cabal database:

$ cabal update

Building:

$ hg clone https://bitbucket.org/balta2ar/imagepaste
$ cd imagepaste
$ cabal install

Using

The only required argument is file name:

$ imp path/to/image.jpg

The program will print image link upon successful paste. You can also explicitly specify engine name:

$ imp rg path/to/image.jpg

Engine name can be incomplete but must not be ambiguous:

$ imp im image.jpg 
error: ambiguous engine name. can be: imagebin, imgur, imm

Configuration

network_timeout - timeout for network operations, ms. Default value is 10000ms.

engine_auth - authentication info for engines. Specify your name and password for the account here.

try_next_engine_on_error - tells the program to try all engines if paste fails. Note that this option does not work if you specify engine name explicitly: only required engine will be tried.

engine_priority - change default internal engine priority. You can write here you favourite engine first so it will always be tried before others.

file_type_mapping - map file type to engine. Some engines allow to paste not only image files but archives, mp3s and other files too. With this option you can assign specific engine to file type.

Sample configuration:

{
  "network_timeout": 5000,

  "engine_auth": [{"engine": "rghost",
                   "username": "Peter",
                   "password": "D83FJ9z"},

                  {"engine": "ipicture",
                   "username": "Peter",
                   "password": "D9$ffoo"},

                  {"engine": "radikal",
                   "username": "PeterP",
                   "password": "f$90A_V38$"}
                 ],

  "try_next_engine_on_error": true,

  "engine_priority": ["imagebin", "flashtux", "rghost"],

  "file_type_mapping": [{"engine": "rghost",
                         "types": [".mp3", ".ogg"]},

                        {"engine": "ompldr",
                         "types": [".rar", ".zip", ".tar.gz"]},

                        {"engine": "fastpic",
                         "types": [".jpg", ".png"]}
                       ]
}

About

(c) 2010, 2011, 2012 Yuri Bochkarev

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.