Open API

Website Thumbnailer


Example:

Parameter
url (string)
size (string) large or crop default large
Shell
shell> curl -d 'size=crop&url=http://www.google.com' http://www.codejungle.org/api/thumb.php
PHP

<?
/**
* Website Thumbnail
* creates a thumbnail of given url
*
* @param $url string 
* @param $size string optional could be large or crop
*
* @return string url of generated thumbnail
*
* @author andreas beder <office@codejungle.org>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License

**/
function website_thumbnail($url, $size){

    $Curl_Session = curl_init("http://www.codejungle.org/api/thumb.php");
    curl_setopt ($Curl_Session, CURLOPT_POST, 1);
    curl_setopt ($Curl_Session, CURLOPT_POSTFIELDS, "url=$url&size=$size");
    curl_setopt ($Curl_Session, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt ($Curl_Session, CURLOPT_RETURNTRANSFER, 1);
    $response=curl_exec($Curl_Session);
    curl_close ($Curl_Session);
    $xml=simplexml_load_string($response);
    return $xml;
}
?>
Response
<?xml version="1.0"?>
<!DOCTYPE result SYSTEM "http://codejungle.org/api/thumb.dtd">
<result>http://www.codejungle.org/api/thumb/xxx.jpg</result>

Another method via get method:
http://codejungle.org/api/thumb_get.php?url=http://www.google.com

Now a Python QT Gui is also avaible: Screenshot | Download

Facedetection


Example:

Shell
shell> curl -F 'face=@localfilename' http://www.codejungle.org/api/face.php
PHP

<?
/**
* Face detection

*
* @param $image string should be the path to your jpeg 

* @return string xml output of my api
*
* @author andreas beder <office@codejungle.org>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
**/

function face_detection($image){

    $data = array("face" => "@".$image);
    $Curl_Session = curl_init("http://www.codejungle.org/api/face.php");
    curl_setopt ($Curl_Session, CURLOPT_POST, 1);
    curl_setopt ($Curl_Session, CURLOPT_POSTFIELDS, $data);
    curl_setopt ($Curl_Session, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt ($Curl_Session, CURLOPT_RETURNTRANSFER, 1);
    $response=curl_exec($Curl_Session);
    curl_close ($Curl_Session);
    return $response;
}
?>
Parameter
face (jpg image)

Response
<?xml version="1.0"?>
<!DOCTYPE face SYSTEM "http://codejungle.org/api/face.dtd">
<face>
        <found>yes</found>
        <image>http://www.codejungle.org/api/face/xxxx.png</image>
</face>

Text Mining

Example

Parameter
text

https://www.codejungle.org/api/sentiment.php?text=Look deep into nature, and then you will understand everything better.

Response
polarity:
0.25
subjectivity:
0.45

Gender Classification

Example:

Parameter
name

http://codejungle.org/api/gender/detection.php?name=andreas

Response
a male example response
{"gender":"male","name":"Andreas"}
or a female response
{"gender":"female","name":"Elisabeth"}
or a not sure response
{"gender":"both","name":"Andrea"}
or 
{"gender":"unknown"}

Radius zip search for Germany, Austria and Switzerland

Example:

Parameter
plz
umkreis (km)
land (de,at,ch)

http://codejungle.org/api/plz.php?plz=23747&umkreis=5&land=de

Distance search for Germany, Austria and Switzerland

Example:

Parameter
von_plz
zu_plz
land (de,at,ch)

http://codejungle.org/api/distanz.php?von_plz=23747&zu_plz=23749&land=de

Response is a integer and in km

GeoIP

Example:

Parameter
ip
format (string) optional could be json, default is xml

Shell

shell> curl -d 'ip=78.41.112.52' http://www.codejungle.org/api/geoip.php
Response
<?xml version="1.0"?>
<!DOCTYPE geoip SYSTEM "http://codejungle.org/api/geo.dtd">
<geoip>
   <country_code>AT</country_code>
   <country_code3>AUT</country_code3>
   <country_name>Austria</country_name>
   <region>09</region>
   <city>Vienna</city>
   <postal_code></postal_code>
   <latitude>48.2000007629</latitude>
   <longitude>16.3666992188</longitude>
   <dma_code>0</dma_code>
   <area_code>0</area_code>
</geoip>


QR Code

Example:

Parameter
s (size i.e. 6)
data (string)


http://www.codejungle.org/api/qr_img.php?s=6&d=http://www.codejungle.org

FAQ

What should i do if something goes wrong?
Make sure your Parameters are url encoded.
Make sure you use the right Parameters and post method
Only for facedetection:
Make sure your image is a jpeg
How works the Website Thumbnailer
I use cutycapt for that.
How works the Facedetection?
I use the opencv lib to detect faces
How works the GeoIP?
I use Maxmind Geolitecity
Why is the facedetection/thumbnailing so slow?
It can take up to 30 sec to process a request.
If you need a faster soloution, contact me.
How much does it cost ?
Nothing.
Do i need an API Key ?
No
How can i contact you?
office@codejungle.org

Changelog

13.08.2016 Added Text Mining
12.08.2016 Fixed some issues due server migration
23.11.2013 Fixed problems with thumb_get.php
30.09.2013 Added Gender Classification
25.09.2013 Fixed dead Link
26.06.2013 Added documentation for QR Code generation api
27.12.2012 Moved Server too a new location
13.02.2011 Fixed facedetection (some error occure due system upgrade)
07.09.2010 Added Distance search
08.06.2010 Added ZIP radius search
27.04.2010 Python QT GUI for Website Thumbnailer (thx 2 mario from unite-it.at)
02.03.2010 Added json output and dtd for geoip
18.02.2010 Added GEOIP
04.11.2009 Updated dokumentation (added php examples)
03.11.2009 Fixed major bug in Facedetection.
02.11.2009 Added variable size to website thumnailer with parameter crop or large, default is large.