schedule-scraper 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -65,14 +65,19 @@ or
65
65
 
66
66
  schedule.to_ical
67
67
 
68
- ## TODO
68
+ You can also skip passing the schedule type and just supply a valid URL:
69
69
 
70
- 1. Add other schedule types
70
+ url = "http://pinevilleice.ezleagues.ezfacility.com/teams/1026121/The-Schwartz.aspx"
71
+ schedule = ScheduleScraper.fetch(url)
71
72
 
72
73
  ## Why?
73
74
 
74
75
  To scratch an itch. I play on a couple of ice hockey teams and the rinks use these sites to manage leagues and schedules. These sites do not offer any options for exporing and I got tired of updating my schedule manually every couple of months.
75
76
 
77
+ ## Add Other Schedule Sypes
78
+
79
+ The heart of this gem is wrapping the [nibbler](https://github.com/mislav/nibbler) gem. If you'd like to add another schedule type you'll need to add a namespaced Schedule and Event class that knows how to parse the calendar in question.
80
+
76
81
  ## Contributing
77
82
 
78
83
  1. Fork it
@@ -47,7 +47,6 @@ module ScheduleScraper
47
47
  # end
48
48
 
49
49
  def start_date_time
50
-
51
50
  DateTime.strptime "#{start_date} #{start_time}", '%m/%d/%y %H:%M %P'
52
51
  end
53
52
 
@@ -56,6 +55,10 @@ module ScheduleScraper
56
55
  start_date_time.to_time + 3600
57
56
  end
58
57
 
58
+ def date_time_string(dt)
59
+ dt.strftime "%Y%m%dT%H%M%S"
60
+ end
61
+
59
62
  def private?
60
63
  true
61
64
  end
@@ -83,8 +86,8 @@ module ScheduleScraper
83
86
  def to_ical(cal)
84
87
  cal.event do |event|
85
88
  event.summary description
86
- event.dtstart start_date_time
87
- event.dtend end_date_time
89
+ event.dtstart date_time_string(start_date_time)
90
+ event.dtend date_time_string(end_date_time)
88
91
  event.location ""
89
92
  end
90
93
  end
@@ -1,3 +1,3 @@
1
1
  module ScheduleScraper
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -1,6 +1,7 @@
1
1
  require 'minitest/spec'
2
2
  require 'minitest/autorun'
3
3
  require 'turn/autorun'
4
+ # require 'minitest/pride'
4
5
  require 'vcr'
5
6
 
6
7
  require File.expand_path(File.join(File.dirname(__FILE__), '../lib/schedule-scraper'))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schedule-scraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
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: 2012-07-09 00:00:00.000000000 Z
12
+ date: 2012-07-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nibbler
@@ -211,3 +211,4 @@ test_files:
211
211
  - spec/spec_helper.rb
212
212
  - spec/vcr_cassettes/schwartz_summer_2012.yml
213
213
  - spec/vcr_cassettes/summit_summer_2012.yml
214
+ has_rdoc: