<commit_before>= PennySMS Muncher

A little bit of code to make PennySMS XML requests.

require 'penny_sms'
include PennySMSMuncher
req = PennySMS::XMLRequest.new(penny_sms_api_key, from_email, phone_number, body)

response = req.send_sms

response.success?
  # true
response.status
  # "OK"
req = PennySMS::XMLRequest.new(penny_sms_api_key, from_email, '6175551234', body)

response = req.send_sms 
  # PennySMSMuncher::PennySMS::Response object

response.status
  # "error"
response.success?
  # false
response.fault_code
  # "500"
response.fault_name
  # "Error: unsupported cell number"
response.raw # Net::HTTPOK object
  # <Net::HTTPOK 200 OK  readbody=true>
response.raw.body # string
  # "<?xml version="1.0" ?><methodResponse><fault><value><struct><member><name>faultCode</name><value><i4>500</i4></value></member><member><name>faultString</name><value><string>Error: unsupported cell number</string></value></member></struct></value></fault></methodResponse>\n"
response.data   
  # LibXML::XML::Document object


<commit_msg>a doc tidy up.<commit_after>= PennySMS Muncher

A little bit of code to make PennySMS XML requests.

<code>
>> require 'penny_sms'
>> include PennySMSMuncher
>> req = PennySMS::XMLRequest.new(penny_sms_api_key, from_email, phone_number, body)
...
>> response = req.send_sms
...
>> response.success?
=> true
>> response.status
=> "OK"
>> req = PennySMS::XMLRequest.new(penny_sms_api_key, from_email, '6175551234', body)
...
>> response = req.send_sms # PennySMSMuncher::PennySMS::Response object
...
>> response.status
=> "error"
>> response.success?
=> false
>> response.fault_code
=> "500"
>> response.fault_name
=> "Error: unsupported cell number"
>> response.raw # Net::HTTPOK object
=> #<Net::HTTPOK 200 OK  readbody=true>
>> response.raw.body # string
=> "<?xml version="1.0" ?><methodResponse><fault><value><struct><member><name>faultCode</name><value><i4>500</i4></value></member><member><name>faultString</name><value><string>Error: unsupported cell number</string></value></member></struct></value></fault></methodResponse>\n"
>> response.data   # LibXML::XML::Document object
</code>


{'fraction_non_alphanumeric': 0.16846550915063352, 'fraction_numerical': 0.021586109807602064, 'mean_word_length': 6.1066666666666665, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 2, '>': 95, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6556025', 'n_tokens_mistral': 783, 'n_tokens_neox': 722, 'n_words': 137}