Active 0.0.23 → 0.0.24
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/Active +0 -0
- data/lib/.DS_Store +0 -0
- data/lib/services/.DS_Store +0 -0
- data/lib/services/gsa.rb +26 -4
- data/spec/gsa_spec.rb +11 -0
- data/version.txt +1 -1
- metadata +8 -16
- data/.bnsignore +0 -19
data/bin/Active
CHANGED
File without changes
|
data/lib/.DS_Store
ADDED
Binary file
|
Binary file
|
data/lib/services/gsa.rb
CHANGED
@@ -32,12 +32,20 @@ module Active
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def url
|
35
|
-
@data["
|
35
|
+
if @data["meta"].has_key?("seourl")
|
36
|
+
@data["meta"]["seourl"]
|
37
|
+
else
|
38
|
+
@data["url"]
|
39
|
+
end
|
36
40
|
end
|
37
41
|
|
38
42
|
def categories
|
39
43
|
if @data["meta"]["channel"].class==String
|
40
|
-
|
44
|
+
if @data["meta"]["channel"].index(",")
|
45
|
+
@data["meta"]["channel"].split(",")
|
46
|
+
else
|
47
|
+
[@data["meta"]["channel"]]
|
48
|
+
end
|
41
49
|
else
|
42
50
|
@data["meta"]["channel"]
|
43
51
|
end
|
@@ -55,7 +63,16 @@ module Active
|
|
55
63
|
end
|
56
64
|
|
57
65
|
def primary_category
|
58
|
-
|
66
|
+
# do we have it in the seo url?
|
67
|
+
if @data["meta"].has_key?("seourl")
|
68
|
+
seo_channel = @data["meta"]["seourl"].split("/")
|
69
|
+
if seo_channel.length >2
|
70
|
+
categories.each do |cat|
|
71
|
+
return cat if cat.downcase==seo_channel[3].downcase
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
return categories.first
|
59
76
|
end
|
60
77
|
|
61
78
|
def address
|
@@ -153,7 +170,12 @@ module Active
|
|
153
170
|
# return [nil,nil]
|
154
171
|
def parse_contact_name(value)
|
155
172
|
return nil,nil if value.nil?
|
156
|
-
|
173
|
+
#first name is whats before the space, last name is everything else
|
174
|
+
name = value.split(" ")
|
175
|
+
fname= name[0]
|
176
|
+
name.delete_at(0)
|
177
|
+
lname = name.join(" ")
|
178
|
+
return fname,lname
|
157
179
|
end
|
158
180
|
|
159
181
|
|
data/spec/gsa_spec.rb
CHANGED
@@ -176,6 +176,17 @@ describe GSA do
|
|
176
176
|
g.user.first_name.should eql("Brandon")
|
177
177
|
g.user.last_name.should eql("Burns")
|
178
178
|
end
|
179
|
+
it "should have a valid first and last name" do
|
180
|
+
g = GSA.new(JSON.parse('{"escapedUrl":"http://www.active.com/baseball-league/santee-ca/8th-annual-fall-baseball-classic-8s16s-2010","language":"en","title":"\u003cb\u003e8th Annual Fall Baseball Classic\u003c/b\u003e (\u003cb\u003e8\u0026#39;S\u003c/b\u003e-\u003cb\u003e16\u0026#39;S\u003c/b\u003e) | Santee \u003cb\u003e...\u003c/b\u003e","url":"http://www.active.com/baseball-league/santee-ca/8th-annual-fall-baseball-classic-8s16s-2010","summary":"\u003cb\u003e...\u003c/b\u003e \u003cb\u003e8th Annual Fall Baseball Classic\u003c/b\u003e (\u003cb\u003e8\u0026#39;S\u003c/b\u003e-\u003cb\u003e16\u0026#39;S\u003c/b\u003e). \u003cb\u003e...\u003c/b\u003e Similar \u003cb\u003eBaseball\u003c/b\u003e Events. \u003cb\u003eFalls\u003c/b\u003e Little\u003cbr\u003e League - 2011 Season \u003cb\u003eFall\u003c/b\u003e City, Washington Mon, Feb 28, 2011. \u003cb\u003e...\u003c/b\u003e ","meta":{"startDate":"2010-10-02","eventDate":"2010-10-02T00:00:00-07:00","location":"Santee- SportsPlex","state":"California","endDate":"2010-10-03","eventLongitude":"-116.997","locationName":"Santee- SportsPlex","splitMediaType":"League","lastModifiedDateTime":"2010-10-03 03:13:09.84","endTime":"0:00:00","mediaType":"League","google-site-verification":"","city":"Santee","estParticipants":"2000","startTime":"0:00:00","assetId":["9FA03B5C-C1F4-4A92-BDE1-533BC219CB2D","9fa03b5c-c1f4-4a92-bde1-533bc219cb2d"],"eventId":"1879121","participationCriteria":"All","description":"","longitude":"-116.997","onlineDonationAvailable":"0","substitutionUrl":"1879121","assetName":["8th Annual Fall Baseball Classic (8\'S-16\'S)","8th Annual Fall Baseball Classic (8\'S-16\'S)"],"zip":"92071","contactPhone":"951-789-2065","eventLatitude":"32.86787","eventState":"California","sortDate":"2000-10-02","keywords":"Event","eventAddress":"9951 Riverwalk Drive","contactEmail":"brandon@tripecrownsocal.com","onlineMembershipAvailable":"0","dma":"San Diego","trackbackurl":"http://www.active.com/baseball-league/santee-ca/8th-annual-fall-baseball-classic-8s16s-2010","seourl":"http://www.active.com/baseball-league/santee-ca/8th-annual-fall-baseball-classic-8s16s-2010","country":"United States","onlineRegistrationAvailable":"false","category":"Activities","market":"San Diego","assetTypeId":"EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65","contactName":"City of San Diego","lastModifiedDate":"2010-10-03","eventZip":"92071","latitude":"32.86787","UpdateDateTime":"9/22/2010 11:46:24 AM","channel":"Baseball"}}'))
|
181
|
+
g.user.first_name.should eql("City")
|
182
|
+
g.user.last_name.should eql("of San Diego")
|
183
|
+
end
|
184
|
+
|
185
|
+
it "should pull primary category from seo url" do
|
186
|
+
g = GSA.new(JSON.parse('{"escapedUrl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","language":"en","title":"Seismic Challenge 3.0 | San Francisco, California 94101 \u003cb\u003e...\u003c/b\u003e","url":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","summary":"","meta":{"startDate":"2010-10-02","eventDate":"2010-10-02T00:00:00-07:00","location":"San Francisco Bay","tag":"event:10","state":"California","eventLongitude":"-122.42","endDate":"2010-10-03","lastModifiedDateTime":"2010-10-04 03:08:51.65","splitMediaType":"Event","locationName":"San Francisco Bay","endTime":"0:00:00","mediaType":"Event","city":"San Francisco","google-site-verification":"","estParticipants":"2000","startTime":"0:00:00","assetId":["35A99FCB-E238-4D78-9205-96179F827CB0","35a99fcb-e238-4d78-9205-96179f827cb0"],"eventId":"1883181","participationCriteria":"All","description":"","longitude":"-122.42","onlineDonationAvailable":"0","substitutionUrl":"1883181","assetName":["Seismic Challenge 3.0","Seismic Challenge 3.0"],"eventURL":"http://greaterthanone.org/events/seismic-challenge/","zip":"94101","contactPhone":"415-487-3053","sortDate":"2000-10-02","eventState":"California","eventLatitude":"37.78","keywords":"Event","contactEmail":"eventinfo@sfaf.org","onlineMembershipAvailable":"0","dma":"San Francisco - Oakland - San Jose","trackbackurl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","seourl":"http://www.active.com/cycling/san-francisco-ca/seismic-challenge-30-2010","country":"United States","onlineRegistrationAvailable":"false","category":"Activities","market":"San Francisco - Oakland - San Jose","assetTypeId":"EA4E860A-9DCD-4DAA-A7CA-4A77AD194F65","lastModifiedDate":"2010-10-04","eventZip":"94101","UpdateDateTime":"9/22/2010 11:46:24 AM","latitude":"37.78","channel":"Running,Cycling"}}'))
|
187
|
+
g.primary_category.should eql("Cycling")
|
188
|
+
end
|
189
|
+
|
179
190
|
end
|
180
191
|
|
181
192
|
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.24
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Active
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 49
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
8
|
+
- 24
|
9
|
+
version: 0.0.24
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Jonathan Spooner, Brian Levine
|
@@ -15,18 +14,16 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-10-
|
17
|
+
date: 2010-10-11 00:00:00 -07:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: savon
|
23
22
|
prerelease: false
|
24
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
24
|
requirements:
|
27
25
|
- - ">="
|
28
26
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 17
|
30
27
|
segments:
|
31
28
|
- 0
|
32
29
|
- 7
|
@@ -38,11 +35,9 @@ dependencies:
|
|
38
35
|
name: dalli
|
39
36
|
prerelease: false
|
40
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
38
|
requirements:
|
43
39
|
- - ">="
|
44
40
|
- !ruby/object:Gem::Version
|
45
|
-
hash: 43
|
46
41
|
segments:
|
47
42
|
- 0
|
48
43
|
- 9
|
@@ -54,11 +49,9 @@ dependencies:
|
|
54
49
|
name: bones
|
55
50
|
prerelease: false
|
56
51
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
52
|
requirements:
|
59
53
|
- - ">="
|
60
54
|
- !ruby/object:Gem::Version
|
61
|
-
hash: 25
|
62
55
|
segments:
|
63
56
|
- 3
|
64
57
|
- 4
|
@@ -76,16 +69,19 @@ extra_rdoc_files:
|
|
76
69
|
- History.txt
|
77
70
|
- README.txt
|
78
71
|
- bin/Active
|
72
|
+
- lib/.DS_Store
|
73
|
+
- lib/services/.DS_Store
|
79
74
|
- lib/services/search.txt
|
80
75
|
- version.txt
|
81
76
|
files:
|
82
|
-
- .bnsignore
|
83
77
|
- Active.gemspec
|
84
78
|
- History.txt
|
85
79
|
- README.txt
|
86
80
|
- Rakefile
|
87
81
|
- bin/Active
|
82
|
+
- lib/.DS_Store
|
88
83
|
- lib/Active.rb
|
84
|
+
- lib/services/.DS_Store
|
89
85
|
- lib/services/IActivity.rb
|
90
86
|
- lib/services/_ats.rb
|
91
87
|
- lib/services/active_works.rb
|
@@ -125,27 +121,23 @@ rdoc_options:
|
|
125
121
|
require_paths:
|
126
122
|
- lib
|
127
123
|
required_ruby_version: !ruby/object:Gem::Requirement
|
128
|
-
none: false
|
129
124
|
requirements:
|
130
125
|
- - ">="
|
131
126
|
- !ruby/object:Gem::Version
|
132
|
-
hash: 3
|
133
127
|
segments:
|
134
128
|
- 0
|
135
129
|
version: "0"
|
136
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
131
|
requirements:
|
139
132
|
- - ">="
|
140
133
|
- !ruby/object:Gem::Version
|
141
|
-
hash: 3
|
142
134
|
segments:
|
143
135
|
- 0
|
144
136
|
version: "0"
|
145
137
|
requirements: []
|
146
138
|
|
147
139
|
rubyforge_project: Active
|
148
|
-
rubygems_version: 1.3.
|
140
|
+
rubygems_version: 1.3.6
|
149
141
|
signing_key:
|
150
142
|
specification_version: 3
|
151
143
|
summary: Search api for Active Network
|
data/.bnsignore
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# The list of files that should be ignored by Mr Bones.
|
2
|
-
# Lines that start with '#' are comments.
|
3
|
-
#
|
4
|
-
# A .gitignore file can be used instead by setting it as the ignore
|
5
|
-
# file in your Rakefile:
|
6
|
-
#
|
7
|
-
# Bones {
|
8
|
-
# ignore_file '.gitignore'
|
9
|
-
# }
|
10
|
-
#
|
11
|
-
# For a project with a C extension, the following would be a good set of
|
12
|
-
# exclude patterns (uncomment them if you want to use them):
|
13
|
-
# *.[oa]
|
14
|
-
# *~
|
15
|
-
announcement.txt
|
16
|
-
coverage
|
17
|
-
doc
|
18
|
-
pkg
|
19
|
-
.DS_Store
|