whos_dated_who 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/lib/whos_dated_who/client.rb +3 -1
- data/lib/whos_dated_who/parser.rb +2 -2
- data/lib/whos_dated_who/version.rb +1 -1
- data/spec/acceptance/whos_dated_who_spec.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d437538a3bae9ddbeb70cf7d7ca8b3de01129cd
|
4
|
+
data.tar.gz: 37b4a6fc89ae977bc394cf8073e1a4740f399e1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84daf2404f99ec13db4cb4bfb387f90c2eb0630535d12b198b3ee56600f97d55b11904aa4c95ae3d1baaea7a7c2d7b93c368eb2f187f3a6083f8924e6bce5942
|
7
|
+
data.tar.gz: 7834556f5bee6ee937d4872bf15bb703e07351080948f49117d2a62eaa88f8e357e7e30104b2fa3f72c58df5e9a97e919844df505ce16d3fc11f60155b883ca1
|
data/.travis.yml
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
module WhosDatedWho
|
2
2
|
class Client
|
3
3
|
def fetch(name)
|
4
|
-
|
4
|
+
search = "#{name} dating site:whosdatedwho.com"
|
5
|
+
bing_results = BingClient.new.search(search)
|
5
6
|
url = bing_results.first[:Web].first[:Url]
|
7
|
+
|
6
8
|
resp = Faraday.get(url)
|
7
9
|
|
8
10
|
if resp.success?
|
@@ -17,7 +17,7 @@ module WhosDatedWho
|
|
17
17
|
private
|
18
18
|
|
19
19
|
def extract_bio
|
20
|
-
bio_selector = '#rcol .cbox
|
20
|
+
bio_selector = '#rcol .cbox:nth-child(3)'
|
21
21
|
bio = @doc.css(bio_selector)
|
22
22
|
|
23
23
|
# if it's biography section, skip it
|
@@ -35,7 +35,7 @@ module WhosDatedWho
|
|
35
35
|
current = @doc.css('.pbox.datebox')
|
36
36
|
relationship = {}
|
37
37
|
|
38
|
-
relationship[:human] = current.css('div.
|
38
|
+
relationship[:human] = current.css('div.pb10:first').text
|
39
39
|
relationship[:dates] = current.css('ul li').map(&:content)
|
40
40
|
result[:current_relationship] = relationship
|
41
41
|
|
@@ -6,16 +6,16 @@ describe WhosDatedWho do
|
|
6
6
|
context 'smoke test' do
|
7
7
|
it 'fetches and parses the correct results' do
|
8
8
|
result = client.fetch('Candice Swanepoel')
|
9
|
-
expect(result.status).to eq(:
|
9
|
+
expect(result.status).to eq(:engaged)
|
10
10
|
expect(result.biography.first_name).to eq('Candice')
|
11
11
|
expect(result.biography.last_name).to eq('Swanepoel')
|
12
|
-
expect(result.biography.age).to eq(
|
12
|
+
expect(result.biography.age).to eq(27)
|
13
13
|
|
14
14
|
result = client.fetch('Jennifer Lawrence')
|
15
|
-
expect(result.status).to eq(:
|
15
|
+
expect(result.status).to eq(:dating)
|
16
16
|
expect(result.biography.first_name).to eq('Jennifer')
|
17
17
|
expect(result.biography.last_name).to eq('Lawrence')
|
18
|
-
expect(result.biography.age).to eq(
|
18
|
+
expect(result.biography.age).to eq(25)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whos_dated_who
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Perez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -288,7 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
288
|
version: '0'
|
289
289
|
requirements: []
|
290
290
|
rubyforge_project:
|
291
|
-
rubygems_version: 2.4.5
|
291
|
+
rubygems_version: 2.4.5.1
|
292
292
|
signing_key:
|
293
293
|
specification_version: 4
|
294
294
|
summary: Unofficial API for whosdatedwho.com
|