Chop API
The following document discusses the Roshisoft Chop API and what you can do with it.
http://api.roshisoft.com/chop
Press the Enter or Return key and -- Tadaaa!! -- the following image should appear.
The Roshisoft Chop API returns a PNG-format image in response to a URL.
The image is 100 pixels tall and 100 pixels wide.
As you can see from the first example, parameters are not required.
You can place Chop API images directly into web pages using the <img> tag. This allows you to place your Chop API image on pretty much any web page.
For example:
<img src="http://api.roshisoft.com/chop">
You should also get this:
We are now ready to customize our Chop API image.
NOTE: You can use the Chop API Color Picker with image preview to experiment with various color schemes. ^_^
The following is a more detailed look at the Chop API URL customized color scheme.
Roshisoft Chop API URLs should be typed in the following format, all on one line:
http://api.roshisoft.com/chop?parameter1=p1¶meter2=p2¶meterN=pN
Parameters are delimited with the the ampersand (&) character. You can use these parameters in any order. As shown above in the first example, none of the parameters are required.
Here is an example Chop API image:
Let us look at the parameters of this Chop API image URL:
http://api.roshisoft.com/chop? xm=叉燒包 &fg=ffccff &bg=0000cc &ink=000066 &paper=ff0000
We have the following parameters:
There is one more parameter added to the Chop API.
You can use it to call up a predefined color palette, which is a combination of fg, bg, ink, and paper.
It is called the theme parameter:
Example URL: http://api.roshisoft.com/chop?theme=greentea
NOTE: You can find more Chop API image themes in the Chop API Themes Directory. new!
You can also place the Chop API image in your web page using the <img> tag, with one IMPORTANT tweak involving the ampersand character. You need to change all the & into &.
Here's an example:
<img="http://api.roshisoft.com/chop? xm=叉燒包 &fg=ffccff &bg=0000cc &ink=000066 &paper=ff0000" alt="My Own Chop">
Not all editors can handle Asian (Chinese, Korean, Japanese, etc.) fonts, or even Unicode for that matter. In that case, you can use URL-Encoding for the Chinese or Korean name.
Here's an example with the Chinese Name URL encoded:
<img="http://api.roshisoft.com/chop? xm=%E5%8F%89%E7%87%92%E5%8C%85 &fg=ffccff &bg=0000cc &ink=000066 &paper=ff0000" alt="My Own Chop">
-OR- use WordPress to install it.
Chop API Summary
URI/Endpoint: http://api.roshisoft.com/chop
Formats: PNG (100 x 100 pixels)
Method: GET
Parameters:
* xm Optional. -- Chinese or Korean name (utf-8, multi-btye)
* fg Optional. -- background behind ink/text (hexadecimal)
* bg Optional. -- faceplate color (hexadecimal)
* ink Optional. -- text color (hexadecimal)
* paper Optional. -- chop background color (hexadecimal)
* theme Optional. -- pre-defined color palette that overrides
fg, bg, ink and paper (single-byte, ASCII)
Example URI:
http://api.roshisoft.com/chop?xm=叉燒包&fg=ffccff&bg=ccffcc&ink=ffcccc&paper=ccccff
You now know how to create a basic Roshisoft Chop API image and customize the colors.
I am so happy to share this new Chop API with you.
Have fun! Wishing you world peace and quiet! ^_^
Translations: