<commit_before># PicturepathAUI

[![Build Status](https://travis-ci.org/antillas21/picturepath_aui.svg?branch=master)](https://travis-ci.org/antillas21/picturepath_aui)
[![Code Climate](https://codeclimate.com/github/antillas21/picturepath_aui/badges/gpa.svg)](https://codeclimate.com/github/antillas21/picturepath_aui)

A ruby wrapper around the PicturePath AUI API. PicturePath provides an API to post virtual tours to Realtor.com and other real estate websites.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'picturepath_aui'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install picturepath_aui

## Usage

We want to keep a simple API to make requests to the PicturePath AUI API.

Here's an example on how to do the most basic operation.

```ruby
# First, configure your client connection
client = PicturepathAUI::Client.new(username: "username", password: "password")

# Next, build your request payload
payload = PicturepathAUI::Request.new({
  site: 2845, order_number: 1234, product_line: "LINK",
  street1: "742 Evergreen Terrace", street2: nil, city: "Springfield",
  state: "IL", zip_code: 62701, mls_id: 5678,
  tour_url: "http://www.realestateagent.com/tours?id=12345678"
})

# you can perform a check request (for validation or testing purposes)
client.check(payload)

# to actually send the tour data to Realtor.com, use the :submit method
client.submit(payload)
```

### API Version

By default, the `PicturepathAUI::Client` will use the PicturePath AUI API
version 5.1, however, you can change the API version to use when you
instantiate a client:

```ruby
client = PicturepathAUI::Client.new(
  username: "username", password: "password", api_version: "5.0"
)
```

Of course you will need to check the documentation as to the fields required
to populate your `PicturepathAUI::Request` object for the API version you choose.

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.<commit_msg>Updates README with :api_version changes<commit_after># PicturepathAUI

[![Build Status](https://travis-ci.org/antillas21/picturepath_aui.svg?branch=master)](https://travis-ci.org/antillas21/picturepath_aui)
[![Code Climate](https://codeclimate.com/github/antillas21/picturepath_aui/badges/gpa.svg)](https://codeclimate.com/github/antillas21/picturepath_aui)

A ruby wrapper around the PicturePath AUI API. PicturePath provides an API to post virtual tours to Realtor.com and other real estate websites.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'picturepath_aui'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install picturepath_aui

## Usage

We want to keep a simple API to make requests to the PicturePath AUI API.

Here's an example on how to do the most basic operation.

```ruby
# First, configure your client connection
client = PicturepathAUI::Client.new(username: "username", password: "password")

# Next, build your request payload
payload = PicturepathAUI::Request.new({
  site: 2845, order_number: 1234, product_line: "LINK",
  street1: "742 Evergreen Terrace", street2: nil, city: "Springfield",
  state: "IL", zip_code: 62701, mls_id: 5678,
  tour_url: "http://www.realestateagent.com/tours?id=12345678"
})

# you can perform a check request (for validation or testing purposes)
client.check(payload)

# to actually send the tour data to Realtor.com, use the :submit method
client.submit(payload)
```

### Requests

You don't need to instantiate a `PicturepathAUI::Request` object to perform a
`:check or :submit` request to the PicturePath AUI API, you can pass XML
straight to these methods. However, we thought having a helper class would
greatly ease building the XML document required by PicturePath :wink:

### API Version

By default, the `PicturepathAUI::Request` will use the PicturePath AUI API
version 5.1, however, you can change the API version to use when you
build out a request:

```ruby
request = PicturepathAUI::Request.new({
  api_version: "5.0",
  # ...other attributes...
})
```

Of course you will need to check the documentation as to the fields required
to populate your `PicturepathAUI::Request` object for the API version you choose.

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
{'fraction_non_alphanumeric': 0.09886759581881534, 'fraction_numerical': 0.018292682926829267, 'mean_word_length': 5.02755905511811, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5946544', 'n_tokens_mistral': 1457, 'n_tokens_neox': 1364, 'n_words': 529}