sports_db 0.2.18 → 0.2.19

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,12 @@
1
1
  /*global Application Client */
2
2
  ;(function($){
3
- var MIN = 13;
4
- var MAX = 17;
5
- var DEFAULT = 15;
3
+ var MIN, MAX, DEFAULT;
4
+
5
+ if (Application.params.serverPath === 'nfl4') {
6
+ MIN = 14, MAX = 18, DEFAULT = 16;
7
+ } else {
8
+ MIN = 13, MAX = 17, DEFAULT = 15;
9
+ }
6
10
  var p = Application.params.font_size;
7
11
  var pi = parseInt(p,10);
8
12
  var size = ((!isNaN(p) && pi <= MAX && pi >= MIN)) ? pi : DEFAULT;
@@ -3,9 +3,9 @@
3
3
  display: block;
4
4
  width: 310px;
5
5
  height: 48px;
6
- padding-left: 10px;
6
+ padding: 0 10px;
7
7
  font-weight: bold;
8
8
  font-size: 18px;
9
9
  margin: 0 auto 5px;
10
- line-height: 1.3; // FIXED FB#24805
10
+ line-height: 48px; // FIXED FB#24805
11
11
  }
@@ -1,86 +1,86 @@
1
1
  module SportsDb
2
2
  class SportingNewsFeedBuilder
3
-
3
+
4
4
  def self.update_news_feed
5
- config_feeds = SimpleConfig.for(:feeds)
5
+ config_feeds = SimpleConfig.for(:feeds)
6
6
 
7
- Article.transaction do
8
- # #delete existing articles older than 30 days
9
- # remove_date = TimeService.now - 30.day
7
+ Article.transaction do
8
+ # #delete existing articles older than 30 days
9
+ # remove_date = TimeService.now - 30.day
10
10
  # sn_articles_old = Article.find(:all, :conditions => ["source = 'Sporting News' and published_at > ?", remove_date])
11
11
  # sn_articles_old.each {|article| article.destroy }
12
-
13
- update_webgen_feeds(config_feeds.news_feeds, "news")
14
- update_webgen_feeds(config_feeds.breaking_news_feeds, "breaking")
15
-
16
-
12
+
13
+ update_webgen_feeds(config_feeds.news_feeds, "news")
14
+ update_webgen_feeds(config_feeds.breaking_news_feeds, "breaking")
15
+
16
+
17
17
  if CONFIG.affiliation_key == 'l.nfl.com'
18
- update_webgen_feeds(config_feeds.team_feeds, "pro_team_news")
18
+ update_webgen_feeds(config_feeds.team_feeds, "pro_team_news")
19
19
  elsif CONFIG.affiliation_key == 'l.nba.com'
20
- update_webgen_feeds(config_feeds.team_feeds, "pro_team_news")
20
+ update_webgen_feeds(config_feeds.team_feeds, "pro_team_news")
21
21
  elsif CONFIG.affiliation_key == 'l.mlb.com'
22
- update_webgen_feeds(config_feeds.team_feeds, "pro_team_news")
23
- update_webgen_feeds(config_feeds.fantasy_news_feeds, "fantasy")
22
+ update_webgen_feeds(config_feeds.team_feeds, "pro_team_news")
23
+ update_webgen_feeds(config_feeds.fantasy_news_feeds, "fantasy")
24
24
  elsif CONFIG.affiliation_key.match('l.ncaa.org')
25
- update_webgen_feeds(ExternalFeed.find(:all, :conditions => ["content_type = ? and provider = ?", "news", "Sporting News"]), "ncaa_team_news")
25
+ update_webgen_feeds(ExternalFeed.find(:all, :conditions => ["content_type = ? and provider = ?", "news", "Sporting News"]), "ncaa_team_news")
26
26
  end
27
- end
27
+ end
28
28
  end
29
-
29
+
30
30
  def self.update_webgen_feeds(feed_list, list_type)
31
31
  if list_type == "ncaa_team_news"
32
- feed_list.each do |feed_obj|
33
- feed_team = Team.find(feed_obj.team_id)
34
-
35
- if !feed_team.nil?
36
- feed_url = feed_obj.woven_feed_url
37
- if CONFIG.woven_feed_server != "woven.zumobi.net"
38
- feed_url = feed_url.gsub("woven.zumobi.net", CONFIG.woven_feed_server)
39
- end
40
- list_type = "team_news"
41
-
42
- rss = retrieve_feed(feed_url)
43
- parse_webgen_feeds(rss, feed_team.key, feed_url, list_type, feed_team.city_name)
44
- end
45
- end
32
+ feed_list.each do |feed_obj|
33
+ feed_team = Team.find(feed_obj.team_id)
34
+
35
+ if !feed_team.nil?
36
+ feed_url = feed_obj.woven_feed_url
37
+ if CONFIG.woven_feed_server != "woven.zumobi.net"
38
+ feed_url = feed_url.gsub("woven.zumobi.net", CONFIG.woven_feed_server)
39
+ end
40
+ list_type = "team_news"
41
+
42
+ rss = retrieve_feed(feed_url)
43
+ parse_webgen_feeds(rss, feed_team.key, feed_url, list_type, feed_team.city_name)
44
+ end
45
+ end
46
46
  else
47
- feed_list.each do |feed_title, url|
48
- if list_type == "pro_team_news"
49
- feed_key = feed_title
50
-
51
- if Team.column_names.include?("tsn_key") && feed_key.to_s.match(CONFIG.affiliation_key)
52
- feed_key = tsn_keys_to_stats_key(feed_key)
53
- end
54
- team = Team.find_by_key(feed_key)
55
- feed_title = (!team.nil?) ? team.city_name : feed_title
56
-
57
- elsif list_type == "breaking"
58
- feed_key = CONFIG.affiliation_key
59
- elsif list_type == "news"
60
- feed_key = CONFIG.affiliation_key
61
- elsif list_type == "fantasy"
62
- feed_key = "fantasy"
63
- end
64
-
65
- if !feed_key.blank?
66
- rss = retrieve_feed(url)
67
- if list_type == "pro_team_news"
68
- parse_list_type = "team_news"
69
- else
70
- parse_list_type = list_type
71
- end
72
-
73
- parse_webgen_feeds(rss, feed_key, url, parse_list_type, feed_title)
74
- end
75
- end
76
- end
47
+ feed_list.each do |feed_title, url|
48
+ if list_type == "pro_team_news"
49
+ feed_key = feed_title
50
+
51
+ if Team.column_names.include?("tsn_key") && feed_key.to_s.match(CONFIG.affiliation_key)
52
+ feed_key = tsn_keys_to_stats_key(feed_key)
53
+ end
54
+ team = Team.find_by_key(feed_key)
55
+ feed_title = (!team.nil?) ? team.city_name : feed_title
56
+
57
+ elsif list_type == "breaking"
58
+ feed_key = CONFIG.affiliation_key
59
+ elsif list_type == "news"
60
+ feed_key = CONFIG.affiliation_key
61
+ elsif list_type == "fantasy"
62
+ feed_key = "fantasy"
63
+ end
64
+
65
+ if !feed_key.blank?
66
+ rss = retrieve_feed(url)
67
+ if list_type == "pro_team_news"
68
+ parse_list_type = "team_news"
69
+ else
70
+ parse_list_type = list_type
71
+ end
72
+
73
+ parse_webgen_feeds(rss, feed_key, url, parse_list_type, feed_title)
74
+ end
75
+ end
76
+ end
77
77
  rescue Exception => e
78
78
  Zumobi::ExceptionHandler.error e
79
79
  end
80
-
80
+
81
81
  def self.parse_webgen_feeds(rss, feed_key, url, list_type, feed_title)
82
82
  p "News - #{feed_title} - #{url}"
83
-
83
+
84
84
  article_count = 0
85
85
 
86
86
  doc = Nokogiri::XML(rss)
@@ -108,7 +108,7 @@ class SportingNewsFeedBuilder
108
108
  article_obj.link = node.xpath('link').text
109
109
  article_obj.digest = guid
110
110
  article_obj.source = source
111
-
111
+
112
112
  if list_type == "team_news" || list_type == "team_news_no_filters"
113
113
  article_obj.category = "Team News"
114
114
  elsif list_type == "breaking" || list_type == "news"
@@ -132,15 +132,15 @@ class SportingNewsFeedBuilder
132
132
  thumb_image = (!node.xpath('media:thumbnail').nil?) ? node.xpath('media:thumbnail/@url').text : ""
133
133
  if !thumb_image.blank?
134
134
  if CONFIG.affiliation_key == 'l.nfl.com'
135
- article_obj.thumb_image_url = CONFIG.image_service + 'crop/w/110/url/' + CGI::escape(CGI::escape(thumb_image))
136
- article_obj.article_image_url = CONFIG.image_service + 'transform/w/480/h/480/url/' + CGI::escape(CGI::escape(thumb_image))
135
+ article_obj.thumb_image_url = CONFIG.image_service + 'crop/w/144/url/' + CGI::escape(CGI::escape(thumb_image))
136
+ article_obj.article_image_url = CONFIG.image_service + 'transform/w/540/h/540/url/' + CGI::escape(CGI::escape(thumb_image))
137
137
  else
138
- article_obj.thumb_image_url = CONFIG.image_service + 'crop/w/55/url/' + CGI::escape(CGI::escape(thumb_image))
139
- article_obj.article_image_url = CONFIG.image_service + 'transform/w/280/h/280/url/' + CGI::escape(CGI::escape(thumb_image))
138
+ article_obj.thumb_image_url = CONFIG.image_service + 'crop/w/55/url/' + CGI::escape(CGI::escape(thumb_image))
139
+ article_obj.article_image_url = CONFIG.image_service + 'transform/w/280/h/280/url/' + CGI::escape(CGI::escape(thumb_image))
140
140
  end
141
141
  end
142
142
  end
143
-
143
+
144
144
  if article_obj.title.blank? || article_obj.title == "." || article_obj.contents.blank? || article_obj.contents == "."
145
145
  next
146
146
  end
@@ -170,14 +170,14 @@ class SportingNewsFeedBuilder
170
170
  article_obj.author = (!node.xpath('dc:creator').nil?) ? node.xpath('dc:creator').text : ""
171
171
  article_obj.contents = (!node.xpath('content:encoded').nil?) ? node.xpath('content:encoded').text.strip : ""
172
172
  thumb_image = (!node.xpath('media:thumbnail').nil?) ? node.xpath('media:thumbnail/@url').text : ""
173
-
173
+
174
174
  if !thumb_image.blank?
175
175
  if CONFIG.affiliation_key == 'l.nfl.com'
176
- article_obj.thumb_image_url = CONFIG.image_service + 'crop/w/110/url/' + CGI::escape(CGI::escape(thumb_image))
177
- article_obj.article_image_url = CONFIG.image_service + 'transform/w/480/h/480/url/' + CGI::escape(CGI::escape(thumb_image))
176
+ article_obj.thumb_image_url = CONFIG.image_service + 'crop/w/110/url/' + CGI::escape(CGI::escape(thumb_image))
177
+ article_obj.article_image_url = CONFIG.image_service + 'transform/w/480/h/480/url/' + CGI::escape(CGI::escape(thumb_image))
178
178
  else
179
- article_obj.thumb_image_url = CONFIG.image_service + 'crop/w/55/url/' + CGI::escape(CGI::escape(thumb_image))
180
- article_obj.article_image_url = CONFIG.image_service + 'transform/w/280/h/280/url/' + CGI::escape(CGI::escape(thumb_image))
179
+ article_obj.thumb_image_url = CONFIG.image_service + 'crop/w/55/url/' + CGI::escape(CGI::escape(thumb_image))
180
+ article_obj.article_image_url = CONFIG.image_service + 'transform/w/280/h/280/url/' + CGI::escape(CGI::escape(thumb_image))
181
181
  end
182
182
  end
183
183
  end
@@ -197,16 +197,16 @@ class SportingNewsFeedBuilder
197
197
 
198
198
  if (list_type == "team_news" || list_type == "breaking") && CONFIG.enable_notifications
199
199
  if list_type == "team_news"
200
- if Team.column_names.include?("tsn_key")
201
- team = Team.find_by_key(feed_key)
202
- notify_feed_key = team.tsn_key
203
- else
204
- notify_feed_key = feed_key
205
- end
206
- send_notification(article_obj, notify_feed_key, list_type)
207
- else
208
- send_notification(article_obj, feed_key, list_type)
209
- end
200
+ if Team.column_names.include?("tsn_key")
201
+ team = Team.find_by_key(feed_key)
202
+ notify_feed_key = team.tsn_key
203
+ else
204
+ notify_feed_key = feed_key
205
+ end
206
+ send_notification(article_obj, notify_feed_key, list_type)
207
+ else
208
+ send_notification(article_obj, feed_key, list_type)
209
+ end
210
210
  end
211
211
  end
212
212
 
@@ -225,10 +225,10 @@ class SportingNewsFeedBuilder
225
225
  if feed_key != CONFIG.affiliation_key
226
226
  #team
227
227
  if Team.column_names.include?("tsn_key") && feed_key.to_s.match(CONFIG.affiliation_key)
228
- feed_key = tsn_keys_to_stats_key(feed_key)
229
- end
228
+ feed_key = tsn_keys_to_stats_key(feed_key)
229
+ end
230
230
  team = Team.find_by_key(feed_key)
231
-
231
+
232
232
  if !team.nil?
233
233
  if !article.news_filters.find(:first, :conditions => ["news_filter_key = ?", team.key])
234
234
  filter_team = NewsFilter.find(:first, :conditions => ["news_filter_key = ?", team.key])
@@ -239,9 +239,9 @@ class SportingNewsFeedBuilder
239
239
 
240
240
  #conference
241
241
  if CONFIG.affiliation_key.match('l.ncaa.org')
242
- conference_key = team.conference.key
242
+ conference_key = team.conference.key
243
243
  else
244
- conference_key = team.conference
244
+ conference_key = team.conference
245
245
  end
246
246
  if !article.news_filters.find(:first, :conditions => ["news_filter_key = ?", conference_key])
247
247
  filter_conference = NewsFilter.find(:first, :conditions => ["news_filter_key = ?", conference_key])
@@ -265,23 +265,23 @@ class SportingNewsFeedBuilder
265
265
  if !article.news_filters.find(:first, :conditions => "news_filter_key = 'fantasy'")
266
266
  filter = NewsFilter.find(:first, :conditions => ["news_filter_key = 'fantasy'"])
267
267
  if !filter.nil?
268
- filter.articles << article
269
- filter.save
270
- end
268
+ filter.articles << article
269
+ filter.save
270
+ end
271
271
  end
272
272
  end
273
-
273
+
274
274
  def self.remove_flash_elements(article)
275
275
  doc = Nokogiri::HTML(article.contents)
276
276
  objects = doc.search("embed")
277
277
  objects.each do |obj|
278
278
  obj.remove
279
- end
280
-
279
+ end
280
+
281
281
  contents = doc.children[1].to_html
282
282
  contents = contents.gsub("<html><body>\n", '')
283
283
  contents = contents.gsub('</body></html>', '')
284
-
284
+
285
285
  article.contents = contents
286
286
  article.save
287
287
  end
@@ -348,7 +348,7 @@ class SportingNewsFeedBuilder
348
348
  # sound (optional) - Whether or not to play a sound when the notification is sent. A value of ÔøΩtrueÔøΩ, ÔøΩ1ÔøΩ, or ÔøΩyesÔøΩ means to play the sound. Any other values will not play a sound.
349
349
  def self.send_push_notification(alert_text, tags, digest)
350
350
  p "--Notified! '#{alert_text[0,50]}' at #{DateTime.now.to_s}: Tag: #{tags}"
351
-
351
+
352
352
  notifier = Zumobi::Notifier.new
353
353
  notifier.push({
354
354
  :aps => {:alert => alert_text, :sound => "1"},
@@ -363,175 +363,175 @@ class SportingNewsFeedBuilder
363
363
  body = make_request(url)
364
364
  body
365
365
  end
366
-
367
-
368
- def self.remove_dup_and_old_articles()
369
- teams = Team.find(:all, :conditions => ["division is not null"])
370
- teams.each do |t|
371
- p "#{t.city_name} #{t.team_name}"
372
-
373
- news_filter = NewsFilter.find(:first, :conditions => ["news_filter_key = ?", t.key])
374
- remove_by_news_filter(news_filter)
375
- end
376
-
377
- p "All"
378
- news_filter = NewsFilter.find(:first, :conditions => ["news_filter_key = ?", "all"])
379
- remove_by_news_filter(news_filter)
380
- end
381
-
366
+
367
+
368
+ def self.remove_dup_and_old_articles()
369
+ teams = Team.find(:all, :conditions => ["division is not null"])
370
+ teams.each do |t|
371
+ p "#{t.city_name} #{t.team_name}"
372
+
373
+ news_filter = NewsFilter.find(:first, :conditions => ["news_filter_key = ?", t.key])
374
+ remove_by_news_filter(news_filter)
375
+ end
376
+
377
+ p "All"
378
+ news_filter = NewsFilter.find(:first, :conditions => ["news_filter_key = ?", "all"])
379
+ remove_by_news_filter(news_filter)
380
+ end
381
+
382
382
  def self.remove_by_news_filter(news_filter)
383
- if !news_filter.nil?
384
- article_titles = {}
385
- team_articles = news_filter.articles.find(:all)
386
-
387
- team_articles.each do |a|
388
- article_digest = Digest::SHA1.hexdigest(a.sn_url)
389
-
390
- if article_titles[article_digest].blank?
391
- article_titles[article_digest] = a
392
- p "---- #{a.title}"
393
- else
394
- p "Dup! - #{a.title}"
395
-
396
- this_article = a
397
- saved_article = article_titles[article_digest]
398
-
399
- if this_article.published_at > saved_article.published_at
400
- article_titles[article_digest] = this_article
401
- saved_article.destroy
402
- else
403
- this_article.destroy
404
- end
405
- end
406
- end
407
- end
383
+ if !news_filter.nil?
384
+ article_titles = {}
385
+ team_articles = news_filter.articles.find(:all)
386
+
387
+ team_articles.each do |a|
388
+ article_digest = Digest::SHA1.hexdigest(a.sn_url)
389
+
390
+ if article_titles[article_digest].blank?
391
+ article_titles[article_digest] = a
392
+ p "---- #{a.title}"
393
+ else
394
+ p "Dup! - #{a.title}"
395
+
396
+ this_article = a
397
+ saved_article = article_titles[article_digest]
398
+
399
+ if this_article.published_at > saved_article.published_at
400
+ article_titles[article_digest] = this_article
401
+ saved_article.destroy
402
+ else
403
+ this_article.destroy
404
+ end
405
+ end
406
+ end
407
+ end
408
408
  end
409
409
 
410
410
  private
411
411
 
412
412
  def self.make_request(url)
413
- begin
414
- c = Curl::Easy.perform(url) do |curl|
415
- curl.connect_timeout = 120
416
- curl.follow_location = true
417
- curl.max_redirects = 10
418
- curl.timeout = 120
419
- curl.encoding = 'gzip'
420
- # curl.verbose = true
421
- end
422
- c.body_str
423
- rescue Curl::Err::TimeoutError
424
- #
425
- rescue Curl::Err::GotNothingError
426
- #
427
- rescue Curl::Err::RecvError
428
- #
429
- end
413
+ begin
414
+ c = Curl::Easy.perform(url) do |curl|
415
+ curl.connect_timeout = 120
416
+ curl.follow_location = true
417
+ curl.max_redirects = 10
418
+ curl.timeout = 120
419
+ curl.encoding = 'gzip'
420
+ # curl.verbose = true
421
+ end
422
+ c.body_str
423
+ rescue Curl::Err::TimeoutError
424
+ #
425
+ rescue Curl::Err::GotNothingError
426
+ #
427
+ rescue Curl::Err::RecvError
428
+ #
429
+ end
430
430
  end
431
-
431
+
432
432
  def self.tsn_keys_to_stats_key(tsn_key)
433
- #static map for stats global-id to tsn team_key
434
- keys = {
435
- "l.nfl.com-t.1" => 324,
436
- "l.nfl.com-t.2" => 338,
437
- "l.nfl.com-t.3" => 345,
438
- "l.nfl.com-t.4" => 348,
439
- "l.nfl.com-t.5" => 352,
440
- "l.nfl.com-t.6" => 366,
441
- "l.nfl.com-t.7" => 327,
442
- "l.nfl.com-t.8" => 329,
443
- "l.nfl.com-t.9" => 365,
444
- "l.nfl.com-t.10" => 356,
445
- "l.nfl.com-t.11" => 336,
446
- "l.nfl.com-t.12" => 332,
447
- "l.nfl.com-t.13" => 339,
448
- "l.nfl.com-t.14" => 341,
449
- "l.nfl.com-t.15" => 357,
450
- "l.nfl.com-t.16" => 361,
451
- "l.nfl.com-t.17" => 355,
452
- "l.nfl.com-t.18" => 331,
453
- "l.nfl.com-t.19" => 351,
454
- "l.nfl.com-t.20" => 354,
455
- "l.nfl.com-t.21" => 363,
456
- "l.nfl.com-t.22" => 326,
457
- "l.nfl.com-t.23" => 334,
458
- "l.nfl.com-t.24" => 335,
459
- "l.nfl.com-t.25" => 347,
460
- "l.nfl.com-t.26" => 362,
461
- "l.nfl.com-t.27" => 323,
462
- "l.nfl.com-t.28" => 343,
463
- "l.nfl.com-t.29" => 364,
464
- "l.nfl.com-t.30" => 350,
465
- "l.nfl.com-t.31" => 359,
466
- "l.nfl.com-t.32" => 325,
467
- "l.mlb.com-t.1" => 225,
468
- "l.mlb.com-t.2" => 226,
469
- "l.mlb.com-t.3" => 234,
470
- "l.mlb.com-t.4" => 254,
471
- "l.mlb.com-t.5" => 238,
472
- "l.mlb.com-t.6" => 228,
473
- "l.mlb.com-t.7" => 229,
474
- "l.mlb.com-t.8" => 230,
475
- "l.mlb.com-t.9" => 231,
476
- "l.mlb.com-t.10" => 233,
477
- "l.mlb.com-t.11" => 227,
478
- "l.mlb.com-t.12" => 235,
479
- "l.mlb.com-t.13" => 236,
480
- "l.mlb.com-t.14" => 237,
481
- "l.mlb.com-t.15" => 239,
482
- "l.mlb.com-t.16" => 252,
483
- "l.mlb.com-t.17" => 244,
484
- "l.mlb.com-t.18" => 245,
485
- "l.mlb.com-t.19" => 246,
486
- "l.mlb.com-t.20" => 240,
487
- "l.mlb.com-t.21" => 241,
488
- "l.mlb.com-t.22" => 242,
489
- "l.mlb.com-t.23" => 232,
490
- "l.mlb.com-t.24" => 247,
491
- "l.mlb.com-t.25" => 248,
492
- "l.mlb.com-t.26" => 253,
493
- "l.mlb.com-t.27" => 251,
494
- "l.mlb.com-t.28" => 243,
495
- "l.mlb.com-t.29" => 249,
496
- "l.mlb.com-t.30" => 250,
497
- "l.nba.com-t.1" => 2,
498
- "l.nba.com-t.2" => 14,
499
- "l.nba.com-t.3" => 17,
500
- "l.nba.com-t.4" => 18,
501
- "l.nba.com-t.5" => 19,
502
- "l.nba.com-t.6" => 20,
503
- "l.nba.com-t.7" => 27,
504
- "l.nba.com-t.8" => 1,
505
- "l.nba.com-t.9" => 3,
506
- "l.nba.com-t.10" => 4,
507
- "l.nba.com-t.11" => 5,
508
- "l.nba.com-t.12" => 8,
509
- "l.nba.com-t.13" => 11,
510
- "l.nba.com-t.14" => 15,
511
- "l.nba.com-t.15" => 28,
512
- "l.nba.com-t.16" => 6,
513
- "l.nba.com-t.17" => 7,
514
- "l.nba.com-t.18" => 10,
515
- "l.nba.com-t.19" => 29,
516
- "l.nba.com-t.20" => 16,
517
- "l.nba.com-t.21" => 24,
518
- "l.nba.com-t.22" => 26,
519
- "l.nba.com-t.23" => 9,
520
- "l.nba.com-t.24" => 12,
521
- "l.nba.com-t.25" => 13,
522
- "l.nba.com-t.26" => 21,
523
- "l.nba.com-t.27" => 22,
524
- "l.nba.com-t.28" => 23,
525
- "l.nba.com-t.29" => 25,
526
- "l.nba.com-t.32" => 5312
527
- }
528
-
529
- if !tsn_key.blank? && !keys[tsn_key].blank?
530
- return keys[tsn_key]
531
- else
532
- return ''
533
- end
433
+ #static map for stats global-id to tsn team_key
434
+ keys = {
435
+ "l.nfl.com-t.1" => 324,
436
+ "l.nfl.com-t.2" => 338,
437
+ "l.nfl.com-t.3" => 345,
438
+ "l.nfl.com-t.4" => 348,
439
+ "l.nfl.com-t.5" => 352,
440
+ "l.nfl.com-t.6" => 366,
441
+ "l.nfl.com-t.7" => 327,
442
+ "l.nfl.com-t.8" => 329,
443
+ "l.nfl.com-t.9" => 365,
444
+ "l.nfl.com-t.10" => 356,
445
+ "l.nfl.com-t.11" => 336,
446
+ "l.nfl.com-t.12" => 332,
447
+ "l.nfl.com-t.13" => 339,
448
+ "l.nfl.com-t.14" => 341,
449
+ "l.nfl.com-t.15" => 357,
450
+ "l.nfl.com-t.16" => 361,
451
+ "l.nfl.com-t.17" => 355,
452
+ "l.nfl.com-t.18" => 331,
453
+ "l.nfl.com-t.19" => 351,
454
+ "l.nfl.com-t.20" => 354,
455
+ "l.nfl.com-t.21" => 363,
456
+ "l.nfl.com-t.22" => 326,
457
+ "l.nfl.com-t.23" => 334,
458
+ "l.nfl.com-t.24" => 335,
459
+ "l.nfl.com-t.25" => 347,
460
+ "l.nfl.com-t.26" => 362,
461
+ "l.nfl.com-t.27" => 323,
462
+ "l.nfl.com-t.28" => 343,
463
+ "l.nfl.com-t.29" => 364,
464
+ "l.nfl.com-t.30" => 350,
465
+ "l.nfl.com-t.31" => 359,
466
+ "l.nfl.com-t.32" => 325,
467
+ "l.mlb.com-t.1" => 225,
468
+ "l.mlb.com-t.2" => 226,
469
+ "l.mlb.com-t.3" => 234,
470
+ "l.mlb.com-t.4" => 254,
471
+ "l.mlb.com-t.5" => 238,
472
+ "l.mlb.com-t.6" => 228,
473
+ "l.mlb.com-t.7" => 229,
474
+ "l.mlb.com-t.8" => 230,
475
+ "l.mlb.com-t.9" => 231,
476
+ "l.mlb.com-t.10" => 233,
477
+ "l.mlb.com-t.11" => 227,
478
+ "l.mlb.com-t.12" => 235,
479
+ "l.mlb.com-t.13" => 236,
480
+ "l.mlb.com-t.14" => 237,
481
+ "l.mlb.com-t.15" => 239,
482
+ "l.mlb.com-t.16" => 252,
483
+ "l.mlb.com-t.17" => 244,
484
+ "l.mlb.com-t.18" => 245,
485
+ "l.mlb.com-t.19" => 246,
486
+ "l.mlb.com-t.20" => 240,
487
+ "l.mlb.com-t.21" => 241,
488
+ "l.mlb.com-t.22" => 242,
489
+ "l.mlb.com-t.23" => 232,
490
+ "l.mlb.com-t.24" => 247,
491
+ "l.mlb.com-t.25" => 248,
492
+ "l.mlb.com-t.26" => 253,
493
+ "l.mlb.com-t.27" => 251,
494
+ "l.mlb.com-t.28" => 243,
495
+ "l.mlb.com-t.29" => 249,
496
+ "l.mlb.com-t.30" => 250,
497
+ "l.nba.com-t.1" => 2,
498
+ "l.nba.com-t.2" => 14,
499
+ "l.nba.com-t.3" => 17,
500
+ "l.nba.com-t.4" => 18,
501
+ "l.nba.com-t.5" => 19,
502
+ "l.nba.com-t.6" => 20,
503
+ "l.nba.com-t.7" => 27,
504
+ "l.nba.com-t.8" => 1,
505
+ "l.nba.com-t.9" => 3,
506
+ "l.nba.com-t.10" => 4,
507
+ "l.nba.com-t.11" => 5,
508
+ "l.nba.com-t.12" => 8,
509
+ "l.nba.com-t.13" => 11,
510
+ "l.nba.com-t.14" => 15,
511
+ "l.nba.com-t.15" => 28,
512
+ "l.nba.com-t.16" => 6,
513
+ "l.nba.com-t.17" => 7,
514
+ "l.nba.com-t.18" => 10,
515
+ "l.nba.com-t.19" => 29,
516
+ "l.nba.com-t.20" => 16,
517
+ "l.nba.com-t.21" => 24,
518
+ "l.nba.com-t.22" => 26,
519
+ "l.nba.com-t.23" => 9,
520
+ "l.nba.com-t.24" => 12,
521
+ "l.nba.com-t.25" => 13,
522
+ "l.nba.com-t.26" => 21,
523
+ "l.nba.com-t.27" => 22,
524
+ "l.nba.com-t.28" => 23,
525
+ "l.nba.com-t.29" => 25,
526
+ "l.nba.com-t.32" => 5312
527
+ }
528
+
529
+ if !tsn_key.blank? && !keys[tsn_key].blank?
530
+ return keys[tsn_key]
531
+ else
532
+ return ''
533
+ end
534
534
  end
535
535
 
536
536
  end
537
- end
537
+ end
@@ -9,5 +9,5 @@
9
9
  # available as extensions to the MAJOR.MINOR.PATCH format.
10
10
 
11
11
  module SportsDb
12
- VERSION = "0.2.18"
12
+ VERSION = "0.2.19"
13
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sports_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.18
4
+ version: 0.2.19
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-14 00:00:00.000000000 Z
12
+ date: 2013-08-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails