Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'd like to have bindings for various languages, to be able to use it like

    placeholder=new Kitten('random');


Here's javascript, the other languages are left as an exercise.

    function Kitten(width, height, color) {
        var img, g, w, h;

        w = parseInt(width,  10);
        h = parseInt(height, 10);
        g = color ? "" : "g/";
        img = document.createElement('img');
        img.src = "http://placekitten.com/" + g + w + "/" + h;
        img.width = w;
        img.height = h;

        return img;
    };




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: