seattle_events 1.1.3 → 1.1.4
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 +4 -4
- data/bin/seattle_events +2 -2
- data/lib/seattle_events/cli.rb +1 -3
- data/lib/seattle_events/events.rb +20 -13
- data/lib/seattle_events/version.rb +1 -1
- data/seattle_events.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 15efcf8727d7c8d9ba3dfff5f7e4b46f2c2722e3
|
|
4
|
+
data.tar.gz: f8f1c54ce470e12e5543211656eb506b5856d5f1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9b75cd466d1a20844121ecba8bc33c87ff322efea0d4bfd3b5a74a0841616f8d84433f409ce1c9c0082f7cd1cae3629ca77b5aa37994dad4aa65722cce02a4e5
|
|
7
|
+
data.tar.gz: 4473e914f1c3a2908f600734b931af563f596cc336cf3d62b9586d9c5d6f80c23021ce2dd1216c130a4f6af2ab44bd299fd4d0cc3ef5860ce15b9feaa3d86457
|
data/bin/seattle_events
CHANGED
data/lib/seattle_events/cli.rb
CHANGED
|
@@ -9,11 +9,9 @@ class SeattleEvents::CLI
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def list_events
|
|
12
|
-
|
|
13
|
-
@events = SeattleEvents::Events.list
|
|
12
|
+
@events = SeattleEvents::Events.all
|
|
14
13
|
@events.each.with_index(1) do |event, i|
|
|
15
14
|
puts "#{i}. #{event.date} - #{event.name}"
|
|
16
|
-
# @counter +=1
|
|
17
15
|
end
|
|
18
16
|
puts ""
|
|
19
17
|
end
|
|
@@ -2,23 +2,30 @@ class SeattleEvents::Events
|
|
|
2
2
|
|
|
3
3
|
attr_accessor :date, :name, :time, :location, :rsvp_url
|
|
4
4
|
|
|
5
|
-
def
|
|
6
|
-
|
|
5
|
+
def initialize(attributes = {})
|
|
6
|
+
@date = attributes[:date]
|
|
7
|
+
@name = attributes[:name]
|
|
8
|
+
@time = attributes[:time]
|
|
9
|
+
@location = attributes[:location]
|
|
10
|
+
@rsvp_url = attributes[:rsvp_url]
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def self.all
|
|
14
|
+
@@all ||= scrape_meetups
|
|
7
15
|
end
|
|
8
16
|
|
|
9
17
|
def self.scrape_meetups
|
|
10
|
-
|
|
11
|
-
doc = Nokogiri::HTML(open("https://www.meetup.com/Learn-Code-Seattle/#upcoming"))
|
|
18
|
+
doc = Nokogiri::HTML(open("https://www.meetup.com/Learn-Code-Seattle/"))
|
|
12
19
|
list_doc = doc.search("div#events-list-module li.line.event-item").to_a
|
|
13
|
-
list_doc.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
list_doc.collect.with_index do |event, i|
|
|
21
|
+
name = doc.search("h3.flush--bottom a")[i].text unless doc.search("h3.flush--bottom a")[i] == nil
|
|
22
|
+
self.new({
|
|
23
|
+
date: doc.search(".date")[i].text,
|
|
24
|
+
name: name,
|
|
25
|
+
time: doc.search("span.time")[i].text,
|
|
26
|
+
location: doc.search("dt.event-venuename")[i].text.gsub(/[\n\t]/,""),
|
|
27
|
+
rsvp_url: doc.search("li.rsvp-callout-outer a")[i].attr("href")
|
|
28
|
+
})
|
|
21
29
|
end
|
|
22
|
-
events
|
|
23
30
|
end
|
|
24
31
|
end
|
data/seattle_events.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: seattle_events
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kenlyn Terai
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-09-
|
|
11
|
+
date: 2016-09-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|