petfinder_client 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pet_finder.rb +5 -0
- data/lib/pet_finder/client.rb +116 -0
- data/lib/pet_finder/pet.rb +43 -0
- data/lib/pet_finder/shelter.rb +32 -0
- data/spec/cassettes/PetFinder_Client/finding_list_of_pets.yml +157 -0
- data/spec/cassettes/PetFinder_Client/finding_list_of_shelters.yml +75 -0
- data/spec/cassettes/PetFinder_Client/get_single_pet_with_id.yml +98 -0
- data/spec/cassettes/PetFinder_Client/get_single_shelter_with_id.yml +57 -0
- data/spec/cassettes/PetFinder_Client/list_breeds.yml +284 -0
- data/spec/cassettes/PetFinder_Shelter/shelter_pets.yml +141 -0
- data/spec/client_spec.rb +59 -0
- data/spec/live_pf_api_spec.rb +18 -0
- data/spec/pet_spec.rb +10 -0
- data/spec/shelter_spec.rb +18 -0
- data/spec/spec_helper.rb +118 -0
- metadata +100 -0
data/lib/pet_finder.rb
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
module PetFinder
|
2
|
+
|
3
|
+
class InvalidClientError < StandardError
|
4
|
+
end
|
5
|
+
|
6
|
+
class Client
|
7
|
+
|
8
|
+
include HTTParty
|
9
|
+
base_uri 'http://api.petfinder.com/'
|
10
|
+
format :xml
|
11
|
+
|
12
|
+
# TODO: make this a singleton class
|
13
|
+
def initialize(key)
|
14
|
+
Client.default_params({:key => key})
|
15
|
+
end
|
16
|
+
|
17
|
+
## ARGUMENTS:
|
18
|
+
# location string required the ZIP/postal code or city and state where the search should begin
|
19
|
+
## OPTIONS:
|
20
|
+
# name string optional if location is specified full or partial shelter name
|
21
|
+
# offset integer optional offset into the result set (default is 0)
|
22
|
+
# count integer optional how many records to return for this particular API call (default is 25)
|
23
|
+
def find_shelters(location, opts={})
|
24
|
+
query = {
|
25
|
+
:location => location
|
26
|
+
}.merge(opts)
|
27
|
+
res = Client.get('/shelter.find', :query => query).parsed_response['petfinder']['shelters']['shelter']
|
28
|
+
res = [res] unless res.is_a?(Array)
|
29
|
+
res.map{|atts| Shelter.new(atts)} unless res.nil? || res.empty?
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
def get_shelter(shelter_id, opts={})
|
34
|
+
query = {
|
35
|
+
:id => shelter_id
|
36
|
+
}.merge(opts)
|
37
|
+
res = Client.get('/shelter.get', :query => query).parsed_response['petfinder']['shelter']
|
38
|
+
Shelter.new(res) unless res.nil?
|
39
|
+
end
|
40
|
+
|
41
|
+
## breed.list
|
42
|
+
## ARGUMENTS:
|
43
|
+
# animal string required type of animal (barnyard, bird, cat, dog, horse, pig, reptile, smallfurry)
|
44
|
+
def list_breeds(animal)
|
45
|
+
query = {:animal => animal}
|
46
|
+
res = Client.get('/breed.list', :query => query).parsed_response['petfinder']['breeds']['breed']
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
## ARGUMENTS:
|
51
|
+
# location string required the ZIP/postal code or city and state where the search should begin
|
52
|
+
## OPTIONS:
|
53
|
+
# animal string optional type of animal (barnyard, bird, cat, dog, horse, pig, reptile, smallfurry)
|
54
|
+
# breed string optional breed of animal (use pet.listBreeds for a list of valid breeds)
|
55
|
+
# size string optional size of animal (S=small, M=medium, L=large, XL=extra-large)
|
56
|
+
# sex character optional M=male, F=female
|
57
|
+
# age string optional age of the animal (Baby, Young, Adult, Senior)
|
58
|
+
# offset string optional set this to the value of lastOffset returned by a previous call to pet.find, and it will retrieve the next result set
|
59
|
+
# count integer optional how many records to return for this particular API call (default is 25)
|
60
|
+
# output string optional (default=basic) How much of each record to return: basic (no description) or full (includes description)
|
61
|
+
def find_pets(location, opts={})
|
62
|
+
query = {
|
63
|
+
:location => location
|
64
|
+
}.merge(opts)
|
65
|
+
res = Client.get('/pet.find', :query => query).parsed_response['petfinder']['pets']['pet']
|
66
|
+
res = [res] unless res.is_a?(Array)
|
67
|
+
res.map{|p| Pet.new(p)} unless res.nil? || res.empty?
|
68
|
+
end
|
69
|
+
|
70
|
+
|
71
|
+
## NOTE: Recieving 500 error from PF API. Not a very useful request anyways.
|
72
|
+
# ## ARGUMENTS:
|
73
|
+
# # animal string required type of animal (barnyard, bird, cat, dog, horse, pig, reptile, smallfurry)
|
74
|
+
# # breed string required greed of animal(use pet.listBreeds for a list of valid breeds)
|
75
|
+
# ## OPTIONS:
|
76
|
+
# # offset integer optional offset into the result set (default is 0)
|
77
|
+
# # count integer optional how many records to return for this particular API call (default is 25)
|
78
|
+
# def list_shelters_with_breed(animal, breed, opts={})
|
79
|
+
# query = {
|
80
|
+
# :animal => animal,
|
81
|
+
# :breed => breed
|
82
|
+
# }.merge(opts)
|
83
|
+
# res = Client.get('/shelter.listByBreed', :query => query).parsed_response['petfinder']['shelters']['shelter']
|
84
|
+
# end
|
85
|
+
|
86
|
+
|
87
|
+
def get_pet(pet_id, opts={})
|
88
|
+
query = {
|
89
|
+
:id => pet_id
|
90
|
+
}.merge(opts)
|
91
|
+
res = Client.get('/pet.get', :query => query).parsed_response['petfinder']['pet']
|
92
|
+
Pet.new(res) unless res.nil?
|
93
|
+
end
|
94
|
+
|
95
|
+
|
96
|
+
## NOTE: Not very useful ???
|
97
|
+
# ## OPTIONS:
|
98
|
+
# # animal string optional type of animal (barnyard, bird, cat, dog, horse, pig, reptile, smallfurry)
|
99
|
+
# # breed string optional breed of animal (use breeds.list for a list of valid breeds)
|
100
|
+
# # size string optional size of animal (S=small, M=medium, L=large, XL=extra-large)
|
101
|
+
# # sex character optional M=male, F=female
|
102
|
+
# # location string optional the ZIP/postal code or city and state the animal should be located (NOTE: the closest possible animal will be selected)
|
103
|
+
# # shelterid string optional ID of the shelter that posted the pet
|
104
|
+
# # output string optional (default=id) How much of the pet record to return: id, basic, full
|
105
|
+
# def get_random_pet(opts={})
|
106
|
+
# res = Client.get('/pet.getRandom', :query => opts)
|
107
|
+
# Pet.new(res) unless res.nil?
|
108
|
+
# end
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module PetFinder
|
2
|
+
class Pet
|
3
|
+
|
4
|
+
attr_accessor :id, :animal, :breeds, :mix, :age, :name, :shelterId, :size, :sex, :description, :lastUpdate, :status, :media, :contact
|
5
|
+
|
6
|
+
def initialize(atts={})
|
7
|
+
atts.each do |key, value|
|
8
|
+
self.send("#{key}=", value) if respond_to?(key)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def get_photos
|
13
|
+
my_photos = {}
|
14
|
+
photos = media['photos']['photo']
|
15
|
+
all_photos = []
|
16
|
+
0..5.times do |x|
|
17
|
+
all_photos << photos.select do |p|
|
18
|
+
p_id = p.match(/([1-5])-\w+\.jpg$/)[1]
|
19
|
+
p_id == x.to_s
|
20
|
+
end
|
21
|
+
end
|
22
|
+
all_photos.each_with_index do |photo_array, idx|
|
23
|
+
res_hash = {
|
24
|
+
'500x500' => nil,
|
25
|
+
'max50_height' => nil,
|
26
|
+
'300x250' => nil,
|
27
|
+
'max60_wide' => nil,
|
28
|
+
'max95_wide' => nil
|
29
|
+
}
|
30
|
+
photo_array.each do |photo_url|
|
31
|
+
res_hash['500x500'] = photo_url if photo_url.match(/x\.jpg$/)
|
32
|
+
res_hash['max50_height'] = photo_url if photo_url.match(/t\.jpg$/)
|
33
|
+
res_hash['300x250'] = photo_url if photo_url.match(/pn\.jpg$/)
|
34
|
+
res_hash['max60_wide'] = photo_url if photo_url.match(/pnt\.jpg$/)
|
35
|
+
res_hash['max95_wide'] = photo_url if photo_url.match(/fpm\.jpg$/)
|
36
|
+
end
|
37
|
+
my_photos["photo_#{idx.to_s}"] = res_hash unless res_hash.values.compact.empty?
|
38
|
+
end
|
39
|
+
my_photos
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module PetFinder
|
2
|
+
class Shelter
|
3
|
+
|
4
|
+
attr_accessor :address1, :address2, :city, :country, :email, :fax, :id, :latitude, :longitude, :name, :phone, :state, :zip
|
5
|
+
|
6
|
+
|
7
|
+
## Instance Methods
|
8
|
+
def initialize(atts={})
|
9
|
+
atts.each do |key, value|
|
10
|
+
self.send("#{key}=", value) if respond_to?(key)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
## OPTIONS:
|
15
|
+
# status character optional (default=A, public may only list adoptable pets) A=adoptable, H=hold, P=pending, X=adopted/removed
|
16
|
+
# offset integer optional offset into the result set (default is 0)
|
17
|
+
# count integer optional how many records to return for this particular API call (default is 25)
|
18
|
+
# output string optional (default=basic) How much of the pet record to return: id, basic (no description), full
|
19
|
+
def get_pets(opts={})
|
20
|
+
query = {
|
21
|
+
:id => id
|
22
|
+
}.merge(opts)
|
23
|
+
res = Client.get('/shelter.getPets', :query => query).parsed_response['petfinder']['pets']['pet']
|
24
|
+
res = [res] unless res.is_a?(Array)
|
25
|
+
res.map{|p| Pet.new(p)} unless res.nil? || res.empty?
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,157 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.petfinder.com/pet.find?animal=dog&count=2&key=fake&location=San%20Diego,%20CA
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ""
|
9
|
+
headers: {}
|
10
|
+
|
11
|
+
response:
|
12
|
+
status:
|
13
|
+
code: 200
|
14
|
+
message: OK
|
15
|
+
headers:
|
16
|
+
Date:
|
17
|
+
- Sun, 06 May 2012 20:34:19 GMT
|
18
|
+
Server:
|
19
|
+
- Apache/2.2.11 (Unix) mod_apreq2-20051231/2.6.0 mod_perl/2.0.3 Perl/v5.8.8
|
20
|
+
Transfer-Encoding:
|
21
|
+
- chunked
|
22
|
+
Content-Type:
|
23
|
+
- text/xml; charset=iso-8859-1
|
24
|
+
body:
|
25
|
+
encoding: US-ASCII
|
26
|
+
string: |
|
27
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
28
|
+
|
29
|
+
<petfinder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://api.petfinder.com/schemas/0.9/petfinder.xsd">
|
30
|
+
<header>
|
31
|
+
<version>0.1</version>
|
32
|
+
<timestamp>2012-05-06T20:34:20Z</timestamp>
|
33
|
+
<status>
|
34
|
+
<code>100</code>
|
35
|
+
<message />
|
36
|
+
</status>
|
37
|
+
</header>
|
38
|
+
<lastOffset>2</lastOffset>
|
39
|
+
<pets>
|
40
|
+
<pet>
|
41
|
+
<id>19901761</id>
|
42
|
+
<shelterId>CA1827</shelterId>
|
43
|
+
<shelterPetId>Sasha</shelterPetId>
|
44
|
+
<name>Sasha</name>
|
45
|
+
<animal>Dog</animal>
|
46
|
+
<breeds>
|
47
|
+
<breed>Doberman Pinscher</breed>
|
48
|
+
</breeds>
|
49
|
+
<mix>no</mix>
|
50
|
+
<age>Adult</age>
|
51
|
+
<sex>F</sex>
|
52
|
+
<size>L</size>
|
53
|
+
<options>
|
54
|
+
<option>altered</option>
|
55
|
+
<option>hasShots</option>
|
56
|
+
<option>housebroken</option>
|
57
|
+
<option>noCats</option>
|
58
|
+
<option>noDogs</option>
|
59
|
+
<option>noKids</option>
|
60
|
+
</options>
|
61
|
+
<description><![CDATA[<div>Sasha is 7 years old approx. She is great with the right people but not so much with other dogs. She is also over weight right now, but we do have her on a diet and exercise regiment. </div>
|
62
|
+
<br/><a href="http://www.petfinder.com/petdetail/19901761">View this pet on Petfinder.com</a>
|
63
|
+
]]></description>
|
64
|
+
<lastUpdate>2011-09-02T20:32:32Z</lastUpdate>
|
65
|
+
<status>A</status>
|
66
|
+
<media>
|
67
|
+
<photos>
|
68
|
+
<photo id="1" size="x">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-1-x.jpg</photo>
|
69
|
+
<photo id="1" size="fpm">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-1-fpm.jpg</photo>
|
70
|
+
<photo id="1" size="pn">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-1-pn.jpg</photo>
|
71
|
+
<photo id="1" size="pnt">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-1-pnt.jpg</photo>
|
72
|
+
<photo id="1" size="t">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-1-t.jpg</photo>
|
73
|
+
<photo id="2" size="x">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-2-x.jpg</photo>
|
74
|
+
<photo id="2" size="fpm">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-2-fpm.jpg</photo>
|
75
|
+
<photo id="2" size="pn">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-2-pn.jpg</photo>
|
76
|
+
<photo id="2" size="pnt">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-2-pnt.jpg</photo>
|
77
|
+
<photo id="2" size="t">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-2-t.jpg</photo>
|
78
|
+
<photo id="3" size="x">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-3-x.jpg</photo>
|
79
|
+
<photo id="3" size="fpm">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-3-fpm.jpg</photo>
|
80
|
+
<photo id="3" size="pn">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-3-pn.jpg</photo>
|
81
|
+
<photo id="3" size="pnt">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-3-pnt.jpg</photo>
|
82
|
+
<photo id="3" size="t">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-3-t.jpg</photo>
|
83
|
+
</photos>
|
84
|
+
</media>
|
85
|
+
<contact>
|
86
|
+
<address1>c/o Scholefield, P.C.</address1>
|
87
|
+
<address2>501 W. Broadway #1770</address2>
|
88
|
+
<city>San Diego</city>
|
89
|
+
<state>CA</state>
|
90
|
+
<zip>92101</zip>
|
91
|
+
<phone>619-544-0086</phone>
|
92
|
+
<fax>619-544-00445</fax>
|
93
|
+
<email>web@aztecdpc.com</email>
|
94
|
+
</contact>
|
95
|
+
</pet>
|
96
|
+
<pet>
|
97
|
+
<id>20775306</id>
|
98
|
+
<shelterId>CA1827</shelterId>
|
99
|
+
<shelterPetId />
|
100
|
+
<name>Chance</name>
|
101
|
+
<animal>Dog</animal>
|
102
|
+
<breeds>
|
103
|
+
<breed>Doberman Pinscher</breed>
|
104
|
+
</breeds>
|
105
|
+
<mix>no</mix>
|
106
|
+
<age>Adult</age>
|
107
|
+
<sex>M</sex>
|
108
|
+
<size>L</size>
|
109
|
+
<options>
|
110
|
+
<option>altered</option>
|
111
|
+
<option>hasShots</option>
|
112
|
+
<option>noCats</option>
|
113
|
+
<option>noDogs</option>
|
114
|
+
<option>noKids</option>
|
115
|
+
<option>specialNeeds</option>
|
116
|
+
</options>
|
117
|
+
<description><![CDATA[<div>Chance is around 2 1/2 years old, he came to our rescue from a shelter in the L.A area. He is crate trained. He is unsure of new people but once he gets to know you, you are his friend for life. He needs a home where the owner will let Chance get to know you on his terms. He is also unsure around other dogs, but we believe that can be fixed with training. He hypo-thyroid but that is kept in balance with a simple daily medication. </div>
|
118
|
+
<br/><a href="http://www.petfinder.com/petdetail/20775306">View this pet on Petfinder.com</a>
|
119
|
+
]]></description>
|
120
|
+
<lastUpdate>2011-09-02T20:54:37Z</lastUpdate>
|
121
|
+
<status>A</status>
|
122
|
+
<media>
|
123
|
+
<photos>
|
124
|
+
<photo id="1" size="x">http://photos.petfinder.com/photos/US/CA/CA1827/20775306/CA1827.20775306-1-x.jpg</photo>
|
125
|
+
<photo id="1" size="fpm">http://photos.petfinder.com/photos/US/CA/CA1827/20775306/CA1827.20775306-1-fpm.jpg</photo>
|
126
|
+
<photo id="1" size="pn">http://photos.petfinder.com/photos/US/CA/CA1827/20775306/CA1827.20775306-1-pn.jpg</photo>
|
127
|
+
<photo id="1" size="pnt">http://photos.petfinder.com/photos/US/CA/CA1827/20775306/CA1827.20775306-1-pnt.jpg</photo>
|
128
|
+
<photo id="1" size="t">http://photos.petfinder.com/photos/US/CA/CA1827/20775306/CA1827.20775306-1-t.jpg</photo>
|
129
|
+
<photo id="2" size="x">http://photos.petfinder.com/photos/US/CA/CA1827/20775306/CA1827.20775306-2-x.jpg</photo>
|
130
|
+
<photo id="2" size="fpm">http://photos.petfinder.com/photos/US/CA/CA1827/20775306/CA1827.20775306-2-fpm.jpg</photo>
|
131
|
+
<photo id="2" size="pn">http://photos.petfinder.com/photos/US/CA/CA1827/20775306/CA1827.20775306-2-pn.jpg</photo>
|
132
|
+
<photo id="2" size="pnt">http://photos.petfinder.com/photos/US/CA/CA1827/20775306/CA1827.20775306-2-pnt.jpg</photo>
|
133
|
+
<photo id="2" size="t">http://photos.petfinder.com/photos/US/CA/CA1827/20775306/CA1827.20775306-2-t.jpg</photo>
|
134
|
+
<photo id="3" size="x">http://photos.petfinder.com/photos/US/CA/CA1827/20775306/CA1827.20775306-3-x.jpg</photo>
|
135
|
+
<photo id="3" size="fpm">http://photos.petfinder.com/photos/US/CA/CA1827/20775306/CA1827.20775306-3-fpm.jpg</photo>
|
136
|
+
<photo id="3" size="pn">http://photos.petfinder.com/photos/US/CA/CA1827/20775306/CA1827.20775306-3-pn.jpg</photo>
|
137
|
+
<photo id="3" size="pnt">http://photos.petfinder.com/photos/US/CA/CA1827/20775306/CA1827.20775306-3-pnt.jpg</photo>
|
138
|
+
<photo id="3" size="t">http://photos.petfinder.com/photos/US/CA/CA1827/20775306/CA1827.20775306-3-t.jpg</photo>
|
139
|
+
</photos>
|
140
|
+
</media>
|
141
|
+
<contact>
|
142
|
+
<address1>c/o Scholefield, P.C.</address1>
|
143
|
+
<address2>501 W. Broadway #1770</address2>
|
144
|
+
<city>San Diego</city>
|
145
|
+
<state>CA</state>
|
146
|
+
<zip>92101</zip>
|
147
|
+
<phone>619-544-0086</phone>
|
148
|
+
<fax>619-544-00445</fax>
|
149
|
+
<email>web@aztecdpc.com</email>
|
150
|
+
</contact>
|
151
|
+
</pet>
|
152
|
+
</pets>
|
153
|
+
</petfinder>
|
154
|
+
|
155
|
+
http_version:
|
156
|
+
recorded_at: Sun, 06 May 2012 20:34:20 GMT
|
157
|
+
recorded_with: VCR 2.1.1
|
@@ -0,0 +1,75 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.petfinder.com/shelter.find?key=fake&limit=2&location=92102
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ""
|
9
|
+
headers: {}
|
10
|
+
|
11
|
+
response:
|
12
|
+
status:
|
13
|
+
code: 200
|
14
|
+
message: OK
|
15
|
+
headers:
|
16
|
+
Date:
|
17
|
+
- Sun, 29 Apr 2012 21:46:10 GMT
|
18
|
+
Server:
|
19
|
+
- Apache/2.2.11 (Unix) mod_apreq2-20051231/2.6.0 mod_perl/2.0.3 Perl/v5.8.8
|
20
|
+
Transfer-Encoding:
|
21
|
+
- chunked
|
22
|
+
Content-Type:
|
23
|
+
- text/xml; charset=iso-8859-1
|
24
|
+
body:
|
25
|
+
encoding: US-ASCII
|
26
|
+
string: |
|
27
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
28
|
+
|
29
|
+
<petfinder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://api.petfinder.com/schemas/0.9/petfinder.xsd">
|
30
|
+
<header>
|
31
|
+
<version>0.1</version>
|
32
|
+
<timestamp>2012-04-29T21:46:11Z</timestamp>
|
33
|
+
<status>
|
34
|
+
<code>100</code>
|
35
|
+
<message />
|
36
|
+
</status>
|
37
|
+
</header>
|
38
|
+
<lastOffset>25</lastOffset>
|
39
|
+
<shelters>
|
40
|
+
<shelter>
|
41
|
+
<id>CA1080</id>
|
42
|
+
<name>Baja Animal Sanctuary</name>
|
43
|
+
<address1>www.BajaAnimalSanctuary.org</address1>
|
44
|
+
<address2 />
|
45
|
+
<city>San Diego</city>
|
46
|
+
<state>CA</state>
|
47
|
+
<zip>92102</zip>
|
48
|
+
<country>US</country>
|
49
|
+
<latitude>32.714800</latitude>
|
50
|
+
<longitude>-117.118200</longitude>
|
51
|
+
<phone>619-786-7928</phone>
|
52
|
+
<fax />
|
53
|
+
<email>bajadogs@aol.com</email>
|
54
|
+
</shelter>
|
55
|
+
<shelter>
|
56
|
+
<id>CA1482</id>
|
57
|
+
<name>Second Chance Dog Rescue</name>
|
58
|
+
<address1>2435 C Street</address1>
|
59
|
+
<address2>Suite 2</address2>
|
60
|
+
<city>San Diego</city>
|
61
|
+
<state>CA</state>
|
62
|
+
<zip>92102</zip>
|
63
|
+
<country>US</country>
|
64
|
+
<latitude>32.714800</latitude>
|
65
|
+
<longitude>-117.118200</longitude>
|
66
|
+
<phone>619-721-3647</phone>
|
67
|
+
<fax />
|
68
|
+
<email>info@secondchancedogrescue.org</email>
|
69
|
+
</shelter>
|
70
|
+
</shelters>
|
71
|
+
</petfinder>
|
72
|
+
|
73
|
+
http_version:
|
74
|
+
recorded_at: Sun, 29 Apr 2012 21:46:12 GMT
|
75
|
+
recorded_with: VCR 2.1.1
|
@@ -0,0 +1,98 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.petfinder.com/pet.get?id=fake&key=fake
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ""
|
9
|
+
headers: {}
|
10
|
+
|
11
|
+
response:
|
12
|
+
status:
|
13
|
+
code: 200
|
14
|
+
message: OK
|
15
|
+
headers:
|
16
|
+
Date:
|
17
|
+
- Sun, 06 May 2012 20:55:08 GMT
|
18
|
+
Server:
|
19
|
+
- Apache/2.2.11 (Unix) mod_apreq2-20051231/2.6.0 mod_perl/2.0.3 Perl/v5.8.8
|
20
|
+
Transfer-Encoding:
|
21
|
+
- chunked
|
22
|
+
Content-Type:
|
23
|
+
- text/xml; charset=iso-8859-1
|
24
|
+
body:
|
25
|
+
encoding: US-ASCII
|
26
|
+
string: |
|
27
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
28
|
+
|
29
|
+
<petfinder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://api.petfinder.com/schemas/0.9/petfinder.xsd">
|
30
|
+
<header>
|
31
|
+
<version>0.1</version>
|
32
|
+
<timestamp>2012-05-06T20:55:08Z</timestamp>
|
33
|
+
<status>
|
34
|
+
<code>100</code>
|
35
|
+
<message />
|
36
|
+
</status>
|
37
|
+
</header>
|
38
|
+
<pet>
|
39
|
+
<id>19901761</id>
|
40
|
+
<shelterId>CA1827</shelterId>
|
41
|
+
<shelterPetId>Sasha</shelterPetId>
|
42
|
+
<name>Sasha</name>
|
43
|
+
<animal>Dog</animal>
|
44
|
+
<breeds>
|
45
|
+
<breed>Doberman Pinscher</breed>
|
46
|
+
</breeds>
|
47
|
+
<mix>no</mix>
|
48
|
+
<age>Adult</age>
|
49
|
+
<sex>F</sex>
|
50
|
+
<size>L</size>
|
51
|
+
<options>
|
52
|
+
<option>altered</option>
|
53
|
+
<option>hasShots</option>
|
54
|
+
<option>housebroken</option>
|
55
|
+
<option>noCats</option>
|
56
|
+
<option>noDogs</option>
|
57
|
+
<option>noKids</option>
|
58
|
+
</options>
|
59
|
+
<description><![CDATA[<div>Sasha is 7 years old approx. She is great with the right people but not so much with other dogs. She is also over weight right now, but we do have her on a diet and exercise regiment. </div>
|
60
|
+
<br/><a href="http://www.petfinder.com/petdetail/19901761">View this pet on Petfinder.com</a>
|
61
|
+
]]></description>
|
62
|
+
<lastUpdate>2011-09-02T20:32:32Z</lastUpdate>
|
63
|
+
<status>A</status>
|
64
|
+
<media>
|
65
|
+
<photos>
|
66
|
+
<photo id="1" size="x">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-1-x.jpg</photo>
|
67
|
+
<photo id="1" size="fpm">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-1-fpm.jpg</photo>
|
68
|
+
<photo id="1" size="pn">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-1-pn.jpg</photo>
|
69
|
+
<photo id="1" size="pnt">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-1-pnt.jpg</photo>
|
70
|
+
<photo id="1" size="t">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-1-t.jpg</photo>
|
71
|
+
<photo id="2" size="x">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-2-x.jpg</photo>
|
72
|
+
<photo id="2" size="fpm">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-2-fpm.jpg</photo>
|
73
|
+
<photo id="2" size="pn">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-2-pn.jpg</photo>
|
74
|
+
<photo id="2" size="pnt">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-2-pnt.jpg</photo>
|
75
|
+
<photo id="2" size="t">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-2-t.jpg</photo>
|
76
|
+
<photo id="3" size="x">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-3-x.jpg</photo>
|
77
|
+
<photo id="3" size="fpm">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-3-fpm.jpg</photo>
|
78
|
+
<photo id="3" size="pn">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-3-pn.jpg</photo>
|
79
|
+
<photo id="3" size="pnt">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-3-pnt.jpg</photo>
|
80
|
+
<photo id="3" size="t">http://photos.petfinder.com/photos/US/CA/CA1827/19901761/CA1827.19901761-3-t.jpg</photo>
|
81
|
+
</photos>
|
82
|
+
</media>
|
83
|
+
<contact>
|
84
|
+
<address1>c/o Scholefield, P.C.</address1>
|
85
|
+
<address2>501 W. Broadway #1770</address2>
|
86
|
+
<city>San Diego</city>
|
87
|
+
<state>CA</state>
|
88
|
+
<zip>92101</zip>
|
89
|
+
<phone>619-544-0086</phone>
|
90
|
+
<fax>619-544-00445</fax>
|
91
|
+
<email>web@aztecdpc.com</email>
|
92
|
+
</contact>
|
93
|
+
</pet>
|
94
|
+
</petfinder>
|
95
|
+
|
96
|
+
http_version:
|
97
|
+
recorded_at: Sun, 06 May 2012 20:55:08 GMT
|
98
|
+
recorded_with: VCR 2.1.1
|