Ideone is a pastebin, as well as an online compiler and debugger. This project is a Pythonic binding to the Ideone API.
The Ideone API can also be installed with pip
from PyPI using pip install ideone
. Alternately, you can clone the repository and use setup.py like so :
git clone https://github.com/jschaf/ideone-api.git
cd ideone-api
python setup.py install
You need an Ideone account and an API password which you can create at the Ideone registration page. After that, open up a Python shell and begin hacking. :
>>> from ideone import Ideone
>>> i = Ideone('username', 'APIpassword')
>>> i.test()
{'answerToLifeAndEverything': 42,
'error': "OK",
'moreHelp': "ideone.com",
'oOok': True,
'pi': 3.14}
>>> i.create_submission('print(42)', language_name='python')
{'error': 'OK',
'link' : 'LsSbo'}
>>> i.create_submission('print(42)', language_id=166)
{'error': 'OK',
'link' : 'FDfrM'}
>>> i.submission_details('LsSbo')
{'cmpinfo': "",
'date': "2011-04-18 15:24:14",
'error': "OK",
'input': "",
'langId': 116,
'langName': "Python 3",
'langVersion': "python-3.1.2",
'memory': 5852,
'output': 42,
'public': True,
'result': 15,
'signal': 0,
'source': "print(42)",
'status': 0,
'stderr': "",
'time': 0.02}
>>> i.languages()
{'error': 'OK',
'languages': {1: "C++ (gcc-4.3.4)",
2: "Pascal (gpc) (gpc 20070904)",
...
...
...
125: "Falcon (falcon-0.9.6.6)"}}
As of 27 May 2012, Ideone supports the following languages. You don't need to use the full names for language_name
. The simplified name works just as well with this API.
Index | Ideone Full Name | Simplified Name |
---|---|---|
|
C++ (gcc-4.3.4) | C++ |
|
Pascal (gpc) (gpc 20070904) | Pascal |
|
Perl (perl 5.12.1) | Perl |
|
Python (python 2.7.2) | Python |
|
Fortran (gfortran-4.3.4) | Fortran |
|
Whitespace (wspace 0.3) | Whitespace |
|
Ada (gnat-4.3.2) | Ada |
|
Ocaml (ocamlopt 3.10.2) | Ocaml |
|
Intercal (c-intercal 28.0-r1) | Intercal |
|
Java (sun-jdk-1.6.0.31) | Java |
|
C (gcc-4.3.4) | C |
|
Brainf**k (bff-1.0.3.1) | Brainf**k |
|
Assembler (nasm-2.07) | Assembler |
|
CLIPS (clips 6.24) | CLIPS |
|
Prolog (swi) (swipl 5.6.64) | Prolog |
|
Icon (iconc 9.4.3) | Icon |
|
Ruby (ruby-1.9.2) | Ruby |
|
Pike (pike 7.6.86) | Pike |
|
Haskell (ghc-6.8.2) | Haskell |
|
Pascal (fpc) (fpc 2.2.0) | Pascal |
|
Smalltalk (gst 3.1) | Smalltalk |
|
Nice (nicec 0.9.6) | Nice |
|
Lua (luac 5.1.4) | Lua |
|
C# (mono-2.8) | C# |
|
Bash (bash 4.0.35) | Bash |
|
PHP (php 5.2.11) | PHP |
|
Nemerle (ncc 0.9.3) | Nemerle |
|
Common Lisp (clisp) (clisp 2.47) | Common Lisp |
|
Scheme (guile) (guile 1.8.5) | Scheme |
|
C99 strict (gcc-4.3.4) | C99 strict |
|
JavaScript (rhino) (rhino-1.6.5) | JavaScript |
|
Erlang (erl-5.7.3) | Erlang |
|
Tcl (tclsh 8.5.7) | Tcl |
|
Scala (scala-2.9.1) | Scala |
|
SQL (sqlite3-3.7.3) | SQL |
|
Objective-C (gcc-4.5.1) | Objective-C |
|
C++0x (gcc-4.5.1) | C++0x |
|
Assembler (gcc-4.3.4) | Assembler |
|
Perl 6 (rakudo-2010.08) | Perl 6 |
|
Java7 (sun-jdk-1.7.0_03) | Java7 |
|
Text (text 6.10) | Text |
|
VB.NET (mono-2.4.2.3) | VB.NET |
|
D (dmd) (dmd-2.042) | D |
|
AWK (gawk) (gawk-3.1.6) | AWK |
|
AWK (mawk) (mawk-1.3.3) | AWK |
|
COBOL 85 (tinycobol-0.65.9) | COBOL 85 |
|
Forth (gforth-0.7.0) | Forth |
|
Prolog (gnu) (gprolog-1.3.1) | Prolog |
|
bc (bc-1.06.95) | bc |
|
Clojure (clojure 1.3) | Clojure |
|
JavaScript (spidermonkey) (spidermonkey-1.7) | JavaScript |
|
Go (gc-2010-07-14) | Go |
|
Unlambda (unlambda-2.0.0) | Unlambda |
|
Python 3 (python-3.1.2) | Python 3 |
|
R (R-2.11.1) | R |
|
COBOL (open-cobol-1.0) | COBOL |
|
Oz (mozart-1.4.0) | Oz |
|
Groovy (groovy-1.8.6) | Groovy |
|
Nimrod (nimrod-0.8.8) | Nimrod |
|
Factor (factor-0.93) | Factor |
|
F# (fsharp-2.0.0) | F# |
|
Falcon (falcon-0.9.6.6) | Falcon |