<commit_before># RTFM - Real Time Foto Moderator

Real Time Foto Moderator (RTFM) is Crowdsourced Image Moderation, learn more at http://crowdflower.com/rtfm.  This gem is a simple wrapper for interacting with the API.  Keep your app clean!

## Usage

```ruby
RTFM.api_key = "<KEY>..."
#moderate_image accepts an optional metadata hash
res = RTFM.moderate_image("http://mysite.com/images/moderateme.jpg", {:id => 123})
RTFM.retrieve_image(res["image"]["id"])
```

## Exceptions

All exceptions thrown by the gem itself inherit from `RTFM::Error`.  Below are the possible exceptions:

* RateLimitError - (rate limit exceeded)
* PaymentError - (account is out of money)
* AccountError - (your account is not authorized for this service)
* AuthenticationError - (your API key is invalid)
* InvalidRequestError - (one of your parameters is invalid, usually url)
* APIError - (a non 200 response code was returned, see the docs)
* APIConnectionError - (a network error occured)

## Webhook example

We've also included an example Sinatra server to consume webhooks from RTFM.  You can find it at https://github.com/dolores/rtfm-ruby/examples/webhooks.rb

# Acknowledgements

The implementation of this wrapper was inspired heavily by Stripes Ruby implementation (https://github.com/stripe/stripe-ruby).  Thanks to <NAME> & <NAME> for bending RestClient to their will.

# Copyright

Copyright (c) 2012 CrowdFlower. See LICENSE.txt for
further details.
<commit_msg>Minor changes to usage<commit_after># RTFM - Real Time Foto Moderator

Real Time Foto Moderator (RTFM) is Crowdsourced Image Moderation, learn more at http://crowdflower.com/rtfm.  This gem is a simple wrapper for interacting with the API.  Keep your app clean!

## Usage

```shell
gem install rtfm
```

```ruby
require 'rubygems'
require 'rtfm'

RTFM.api_key = "<KEY>..."
#moderate_image accepts an optional metadata hash
res = RTFM.moderate_image("http://mysite.com/images/moderateme.jpg", {:id => 123})
RTFM.retrieve_image(res["image"]["id"])
```

## Exceptions

All exceptions thrown by the gem itself inherit from `RTFM::Error`.  Below are the possible exceptions:

* RateLimitError - (rate limit exceeded)
* PaymentError - (account is out of money)
* AccountError - (your account is not authorized for this service)
* AuthenticationError - (your API key is invalid)
* InvalidRequestError - (one of your parameters is invalid, usually url)
* APIError - (a non 200 response code was returned, see the docs)
* APIConnectionError - (a network error occured)

## Webhook example

We've also included an example Sinatra server to consume webhooks from RTFM.  You can find it at https://github.com/dolores/rtfm-ruby/tree/master/examples

# Acknowledgements

The implementation of this wrapper was inspired heavily by Stripes Ruby implementation (https://github.com/stripe/stripe-ruby).  Thanks to <NAME> & <NAME> for bending RestClient to their will.

# Copyright

Copyright (c) 2012 CrowdFlower. See LICENSE.txt for
further details.

{'fraction_non_alphanumeric': 0.09628886659979939, 'fraction_numerical': 0.006686726847208292, 'mean_word_length': 4.613508442776736, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6010521', 'n_tokens_mistral': 932, 'n_tokens_neox': 860, 'n_words': 349}