BoxLang 🚀 A New JVM Dynamic Language Learn More...
A CFML wrapper to interact with the PicPurify content moderation API.
This component can be installed as standalone or as a ColdBox Module. Either approach requires a simple CommandBox command:
box install picpurify
This package is also a ColdBox module. The module can be configured by creating a picpurify
configuration structure in your application configuration file (config/Coldbox.cfc
) with the following settings:
picpurify = {
apiKey = '<YOUR_API_KEY_GOES_HERE>' // Your PicPurify API Key
};
Then you can inject the CFC via Wirebox:
property name="picpurify" inject="picpurify@picpurify";
Instantiate the component:
picpurify = new picpurify( APIKey = '<YOUR_API_KEY_GOES_HERE>' );
Returns a CFML struct from the API response
var stuResponse = picpurify.analysePicture(
task = 'porn_moderation,suggestive_nudity_moderation',
url_image = '<REMOTE URL FOR IMAGE FILE>'
);
Returns a CFML struct from the API response
var stuResponse = picpurify.analyseVideo(
task = 'porn_moderation,suggestive_nudity_moderation',
url_video = '<REMOTE URL FOR VIDEO FILE>'
);
isNFSW()
is a helper mathod added to this component.
Pass in the CFML struct response from the API request.
Returns a boolean for whether or not the image / video is NSFW (Not Safe For Work)
var isNSFW = picpurify.isNSFW(
apiResponse = stuResponse
);
PicPurify
is based on the official PicPurify API.
$
box install picpurify