silicon_prairie_events 0.0.6

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7f59a3601f0e6eccaf8f8b6bab9984557cc806e1
4
+ data.tar.gz: 53f4f3a2bef7a12dc897489f746370090d6e0f09
5
+ SHA512:
6
+ metadata.gz: 3b39426ba24dbe5c1c5e9b3e73d81a4bc50255eb3eeeab3d303df7166a42b1aa170a9290c2c60ecb781009d734aae9f877ff27f19bbcb38f812fc11efb306083
7
+ data.tar.gz: 105f507c2320ae2aa42f558a8128b67ea56954af733e083da20d2408085b34cb68cbd93819e182f8a05da3979432872baf7817c5095a8738f21742c2842ee1ba
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.gem
11
+ *.bundle
12
+ *.so
13
+ *.o
14
+ *.a
15
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in silicon_prairie_event.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 “Kyle
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # SiliconPrairieEvent
2
+ Event Scraper collecting information from several calendars in the Silicon Prairie.
3
+
4
+ [![Gem Version](https://badge.fury.io/rb/silicon_prairie_event.svg)](http://badge.fury.io/rb/silicon_prairie_event)
5
+
6
+ The gem utilizes an api which is located at:
7
+ https://event-api.herokuapp.com/api/v1/all_events
8
+
9
+ Source code for api:
10
+ https://github.com/omahacodeschool/spn-events-api
11
+
12
+ ## Installation
13
+
14
+ Add this line to your application's Gemfile:
15
+
16
+ ```ruby
17
+ gem 'silicon_prairie_event'
18
+ ```
19
+
20
+ And then execute:
21
+
22
+ $ bundle
23
+
24
+ Or install it yourself as:
25
+
26
+ $ gem install silicon_prairie_event
27
+
28
+ ## Usage
29
+
30
+ This gem is very similar to many other data scraping gems.
31
+
32
+ To retrieve the collection of all events enter:
33
+ ```ruby
34
+ SiliconPrairieEvent::Event.all_events
35
+ ```
36
+ Similiarly calling any of the methods listed below, will return results according to the name of the method.
37
+ ```ruby
38
+ SiliconPrairieEvent::Event.lincoln_events
39
+ SiliconPrairieEvent::Event.tech_omaha_events
40
+ SiliconPrairieEvent::Event.spn_events
41
+ SiliconPrairieEvent::Event.events_today
42
+ SiliconPrairieEvent::Event.rest_of_week
43
+ SiliconPrairieEvent::Event.events_all_week
44
+ SiliconPrairieEvent::Event.events_this_month
45
+ SiliconPrairieEvent::Event.past_events
46
+ SiliconPrairieEvent::Event.events_by_month(month) - month is a String '01', '02', '11, '12'.
47
+ SiliconPrairieEvent::Event.events_near(range) - range is an Integer num, 5 for five miles.
48
+ ```
49
+ ## Contributing
50
+
51
+ 1. Fork it ( https://github.com/omahacodeschool/silicon_prairie_event/fork )
52
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
53
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
54
+ 4. Push to the branch (`git push origin my-new-feature`)
55
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,135 @@
1
+ require_relative "silicon_prairie_event/version"
2
+ require "HTTParty"
3
+
4
+ module SiliconPrairieEvent
5
+ class Event
6
+ attr_reader :id, :bearing, :distance, :event_address, :event_author, :event_date, :event_description, :event_end, :event_name, :event_origin, :event_state, :event_url, :event_zip_code, :event_latitude, :event_longitude
7
+ def initialize(hash)
8
+ @id = hash['event']['id']
9
+ @bearing = hash['event']['bearing']
10
+ @distance = hash['event']['distance']
11
+ @event_address = hash['event']['event_address']
12
+ @event_author = hash['event']['event_author']
13
+ @event_date = hash['event']['event_date']
14
+ @event_description = hash['event']['event_description']
15
+ @event_end = hash['event']['event_end']
16
+ @event_name = hash['event']['event_name']
17
+ @event_origin = hash['event']['event_origin']
18
+ @event_state = hash['event']['event_state']
19
+ @event_url = hash['event']['event_url']
20
+ @event_zip_code = hash['event']['event_zip_code']
21
+ @latitude = hash['event']['latitude']
22
+ @longitude = hash['event']['longitude']
23
+ end
24
+
25
+ def self.all_events
26
+ all_events = []
27
+ response = HTTParty.get("http://event-api.herokuapp.com/api/v1/all_events")
28
+
29
+ response.each do |hash|
30
+ all_events << Event.new(hash)
31
+ end
32
+ all_events
33
+ end
34
+
35
+ def self.lincoln_events
36
+ lincoln_events = []
37
+ response = HTTParty.get("http://event-api.herokuapp.com/api/v1/startup_lincoln_events")
38
+
39
+ response.each do |hash|
40
+ lincoln_events << Event.new(hash)
41
+ end
42
+ lincoln_events
43
+ end
44
+
45
+ def self.events_all_week
46
+ week_events = []
47
+ response = HTTParty.get("http://event-api.herokuapp.com/api/v1/events_all_week")
48
+
49
+ response.each do |hash|
50
+ week_events << Event.new(hash)
51
+ end
52
+ week_events
53
+ end
54
+
55
+ def self.events_by_month(month)
56
+ this_month = []
57
+ response = HTTParty.get("http://event-api.herokuapp.com/api/v1/events_by_month/#{month}")
58
+
59
+ response.each do |hash|
60
+ this_month << Event.new(hash)
61
+ end
62
+ this_month
63
+ end
64
+
65
+ def self.events_near(range)
66
+ near_events = []
67
+ response = HTTParty.get("http://event-api.herokuapp.com/api/v1/events_near/#{range}")
68
+
69
+ response.each do |hash|
70
+ near_events << Event.new(hash)
71
+ end
72
+ near_events
73
+ end
74
+
75
+ def self.rest_of_week
76
+ rest_of_week = []
77
+ response = HTTParty.get("http://event-api.herokuapp.com/api/v1/events_rest_of_week")
78
+
79
+ response.each do |hash|
80
+ rest_of_week << Event.new(hash)
81
+ end
82
+ rest_of_week
83
+ end
84
+
85
+ def self.spn_events
86
+ spn_events = []
87
+ response = HTTParty.get("http://event-api.herokuapp.com/api/v1/spn_events")
88
+
89
+ response.each do |hash|
90
+ spn_events << Event.new(hash)
91
+ end
92
+ spn_events
93
+ end
94
+
95
+ def self.tech_omaha_events
96
+ tech_omaha_events = []
97
+ response = HTTParty.get("http://event-api.herokuapp.com/api/v1/tech_omaha_events")
98
+
99
+ response.each do |hash|
100
+ tech_omaha_events << Event.new(hash)
101
+ end
102
+ tech_omaha_events
103
+ end
104
+
105
+ def self.events_today
106
+ todays_events = []
107
+ response = HTTParty.get("http://event-api.herokuapp.com/api/v1/events_today")
108
+
109
+ response.each do |hash|
110
+ todays_events << Event.new(hash)
111
+ end
112
+ todays_events
113
+ end
114
+
115
+ def self.events_this_month
116
+ events_this_month = []
117
+ response = HTTParty.get("http://event-api.herokuapp.com/api/v1/events_this_month/")
118
+
119
+ response.each do |hash|
120
+ events_this_month << Event.new(hash)
121
+ end
122
+ events_this_month
123
+ end
124
+
125
+ def self.past_events
126
+ past_events = []
127
+ response = HTTParty.get("http://event-api.herokuapp.com/api/v1/past_events")
128
+
129
+ response.each do |hash|
130
+ past_events << Event.new(hash)
131
+ end
132
+ past_events
133
+ end
134
+ end
135
+ end
@@ -0,0 +1,3 @@
1
+ module SiliconPrairieEvent
2
+ VERSION = "0.0.6"
3
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'silicon_prairie_event/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "silicon_prairie_events"
8
+ spec.version = SiliconPrairieEvent::VERSION
9
+ spec.authors = ["“Kyle Schmit and Matt Taylor"]
10
+ spec.email = ["kschmit90@gmail.com"]
11
+ spec.summary = %q{Silicon Prairie Event Scraper}
12
+ spec.description = %q{Event scraper which collects information from several calendars in the Silicon Prairie.}
13
+ spec.homepage = "https://github.com/omahacodeschool/silicon-prairie-events"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.6"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+
24
+ spec.add_dependency 'httparty'
25
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: silicon_prairie_events
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.6
5
+ platform: ruby
6
+ authors:
7
+ - "“Kyle Schmit and Matt Taylor"
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: httparty
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Event scraper which collects information from several calendars in the
56
+ Silicon Prairie.
57
+ email:
58
+ - kschmit90@gmail.com
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - lib/silicon_prairie_event.rb
69
+ - lib/silicon_prairie_event/version.rb
70
+ - silicon_prairie_event-0.0.1.gem
71
+ - silicon_prairie_event-0.0.2.gem
72
+ - silicon_prairie_event-0.0.3.gem
73
+ - silicon_prairie_event-0.0.4.gem
74
+ - silicon_prairie_event-0.0.5.gem
75
+ - silicon_prairie_event.gemspec
76
+ homepage: https://github.com/omahacodeschool/silicon-prairie-events
77
+ licenses:
78
+ - MIT
79
+ metadata: {}
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 2.4.1
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: Silicon Prairie Event Scraper
100
+ test_files: []