yahoo-group-data 1.3.1 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/yahoo-group-data.rb +15 -5
- data/lib/yahoo-group-data/version.rb +1 -1
- data/test/groups.yml +23 -7
- metadata +11 -11
data/lib/yahoo-group-data.rb
CHANGED
@@ -65,8 +65,12 @@ class YahooGroupData
|
|
65
65
|
def not_found?
|
66
66
|
@not_found ||= (response_was_404? ||
|
67
67
|
(
|
68
|
-
|
69
|
-
|
68
|
+
(
|
69
|
+
doc.xpath('/html/body/div[3]/div/div/div/h3').size > 0 and doc.xpath('/html/body/div[3]/div/div/div/h3').first.content.strip.match(/Group Not Found|Group nicht gefunden/i)
|
70
|
+
) ||
|
71
|
+
(
|
72
|
+
doc.xpath('//*[@id="bodyID"]/div[4]/div/div/div/h3').inner_html.strip.match(/Group Not Found|Group nicht gefunden/i)
|
73
|
+
)
|
70
74
|
) ? true : false
|
71
75
|
)
|
72
76
|
end
|
@@ -90,7 +94,7 @@ class YahooGroupData
|
|
90
94
|
|
91
95
|
def category
|
92
96
|
return unless has_category?
|
93
|
-
@category ||= no_data? ? nil : doc.xpath('
|
97
|
+
@category ||= no_data? ? nil : doc.xpath('//*[@id="yginfo"]/ul/li[2]/a').inner_html
|
94
98
|
end
|
95
99
|
|
96
100
|
def to_json
|
@@ -130,8 +134,14 @@ class YahooGroupData
|
|
130
134
|
|
131
135
|
def matches_private?
|
132
136
|
@matches_private ||= (
|
133
|
-
|
134
|
-
|
137
|
+
(
|
138
|
+
doc.xpath('/html/body/div[3]/center/p/big').size > 0 and
|
139
|
+
doc.xpath('/html/body/div[3]/center/p/big').first.content.strip.match(/Sorry, this group is available to members ONLY./i)
|
140
|
+
) ||
|
141
|
+
(
|
142
|
+
doc.xpath('//*[@id="bodyID"]/div[4]/center/p/big/text()[1]') && doc.xpath('//*[@id="bodyID"]/div[4]/center/p/big/text()[1]').first &&
|
143
|
+
doc.xpath('//*[@id="bodyID"]/div[4]/center/p/big/text()[1]').first.content.strip.match(/Sorry, this group is available to members ONLY./i)
|
144
|
+
)
|
135
145
|
) ? true : false
|
136
146
|
end
|
137
147
|
|
data/test/groups.yml
CHANGED
@@ -10,7 +10,7 @@ groups:
|
|
10
10
|
age_restricted: false
|
11
11
|
founded: 2008-06-24
|
12
12
|
language: English
|
13
|
-
num_members:
|
13
|
+
num_members: 160
|
14
14
|
category: COBOL
|
15
15
|
post_email: OneStopCOBOL@yahoogroups.com
|
16
16
|
subscribe_email: OneStopCOBOL-subscribe@yahoogroups.com
|
@@ -27,7 +27,7 @@ groups:
|
|
27
27
|
age_restricted: false
|
28
28
|
founded: 2011-08-24
|
29
29
|
language: English
|
30
|
-
num_members:
|
30
|
+
num_members: 359
|
31
31
|
category: Recycling
|
32
32
|
post_email: Cambridge-Freegle@yahoogroups.com
|
33
33
|
subscribe_email: Cambridge-Freegle-subscribe@yahoogroups.com
|
@@ -51,7 +51,7 @@ groups:
|
|
51
51
|
owner_email:
|
52
52
|
unsubscribe_email:
|
53
53
|
|
54
|
-
# private
|
54
|
+
# private / Members only groups
|
55
55
|
- id: blackpool-freecycle
|
56
56
|
url: http://groups.yahoo.com/group/blackpool-freecycle/
|
57
57
|
name: blackpool-freecycle
|
@@ -68,9 +68,25 @@ groups:
|
|
68
68
|
owner_email:
|
69
69
|
unsubscribe_email:
|
70
70
|
|
71
|
+
- id: anokacountyfc
|
72
|
+
url: http://groups.yahoo.com/group/anokacountyfc/
|
73
|
+
name: anokacountyfc
|
74
|
+
description:
|
75
|
+
not_found: false
|
76
|
+
private: true
|
77
|
+
age_restricted:
|
78
|
+
founded:
|
79
|
+
language:
|
80
|
+
num_members:
|
81
|
+
category:
|
82
|
+
post_email:
|
83
|
+
subscribe_email:
|
84
|
+
owner_email:
|
85
|
+
unsubscribe_email:
|
86
|
+
|
71
87
|
# Age restricted group
|
72
|
-
- id:
|
73
|
-
url: http://groups.yahoo.com/group/
|
88
|
+
- id: Fetish_Groups
|
89
|
+
url: http://groups.yahoo.com/group/Fetish_Groups/
|
74
90
|
name:
|
75
91
|
description:
|
76
92
|
not_found: false
|
@@ -112,7 +128,7 @@ groups:
|
|
112
128
|
age_restricted: false
|
113
129
|
founded: 2007-03-30
|
114
130
|
language: English
|
115
|
-
num_members:
|
131
|
+
num_members: 3019
|
116
132
|
category:
|
117
133
|
post_email: redcar-cleveland-freegle@yahoogroups.com
|
118
134
|
subscribe_email: redcar-cleveland-freegle-subscribe@yahoogroups.com
|
@@ -129,7 +145,7 @@ groups:
|
|
129
145
|
age_restricted: false
|
130
146
|
founded: 2004-05-06
|
131
147
|
language: Deutsch
|
132
|
-
num_members:
|
148
|
+
num_members: 68
|
133
149
|
category: Kostenlos
|
134
150
|
post_email: freecycle-michelstadt@yahoogroups.de
|
135
151
|
subscribe_email: freecycle-michelstadt-subscribe@yahoogroups.de
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yahoo-group-data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-05-18 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
16
|
-
requirement: &
|
16
|
+
requirement: &70138439417020 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.5'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70138439417020
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: yajl-ruby
|
27
|
-
requirement: &
|
27
|
+
requirement: &70138439414500 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '1.1'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70138439414500
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: curb
|
38
|
-
requirement: &
|
38
|
+
requirement: &70138439411500 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0.8'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70138439411500
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: webmock
|
49
|
-
requirement: &
|
49
|
+
requirement: &70138439394340 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70138439394340
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: simplecov
|
60
|
-
requirement: &
|
60
|
+
requirement: &70138439390860 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70138439390860
|
69
69
|
description: A lib to fetch public Yahoo group data
|
70
70
|
email:
|
71
71
|
- will@willj.net
|