Chop API

Roshisoft Chop API lets you build Chinese or Korean chop images.

The following document discusses the Roshisoft Chop API and what you can do with it.


Getting Started

To get started, type in the following URL into your browser:


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.



Customizing Chop API Image Colors

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&parameter2=p2&parameterN=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:

We have the following parameters:





Using Chop API Image Themes new!

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!



Embedding Chop API Image In <IMG> tag

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 &amp;.

Here's an example:

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:

Installing WP-Chop for WordPress




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





Conclusion

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:
Powered By Google Translate













© 2009 Roshisoft