speakerdeck_api 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 64783ecb5e2ae07f2e41ed298ab90ab16acb2513
4
- data.tar.gz: 5b11580580d544528c1c849690e9a3a7e56a8390
3
+ metadata.gz: 69658b838232d6ebdee84368699e4ba1643d0b38
4
+ data.tar.gz: ed75f1f14043bdb2f3c732443f402177c9140cf9
5
5
  SHA512:
6
- metadata.gz: 99eea920280c391e6ba8fcbc19f6c29f2e27a8e63080625a40781376b89bd501269e1c1b224ff3c83bc906fe98ecac1ba6181a759da51c17a79d0c2a98ee9501
7
- data.tar.gz: 6de5e53771d1267a643da190e9435ce0307f7a939187c1f388b5639b006e7b8ef188cfaf89a7f3048776728fc5803311f8d7b16b284e8170d417246183d09aea
6
+ metadata.gz: 93616b104e6e54d640893fbf6b578d56953965994d90834db10b4d4e0a85984063a302a70b5efc089b87e975de5125b00addadc57298e1a92758f3c57fda5d96
7
+ data.tar.gz: 2fd323248124b7cac3d9083a73460bdc9311e9e2950880c039e21b5182cf2e9da1e996d548637b58e9bcf26da3c22b059d1b43735502d4ae694d726fffdd4d1e
@@ -5,7 +5,8 @@ module SpeakerdeckApi
5
5
  info = {}
6
6
  info[:number_of_talks] = speaker_html.css('.talk.public').size
7
7
  info[:name] = speaker_html.css('.sidebar > h2').text
8
- info[:website] = speaker_html.css('.bio > p > a').attribute('href').value
8
+ website = speaker_html.css('.bio > p > a')
9
+ info[:website] = website.empty? ? '' : website.attribute('href').value
9
10
  info
10
11
  end
11
12
  end
@@ -1,3 +1,3 @@
1
1
  module SpeakerdeckApi
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -0,0 +1,200 @@
1
+
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <title>Presentations by Erik Michaels-Ober // Speaker Deck</title>
7
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge">
8
+
9
+ <link href='//fonts.googleapis.com/css?family=Open+Sans:400,300,600&subset=latin,latin-ext,cyrillic,cyrillic-ext' rel='stylesheet' type='text/css'>
10
+ <link href="https://d2dfho4r6t7asi.cloudfront.net/assets/application-31e7b11e971c1191f531d134325dda3f.css" media="screen" rel="stylesheet" type="text/css" />
11
+
12
+ <meta name="octolytics-app-id" content="speakerdeck" /><meta name="octolytics-host" content="collector.githubapp.com" /><meta name="octolytics-script-host" content="collector-cdn.github.com" />
13
+
14
+
15
+ <script src="https://d2dfho4r6t7asi.cloudfront.net/assets/application-de3b0dfb5fa666c00edfef0bbc79a0d7.js" type="text/javascript"></script>
16
+ <!--[if lt IE 9]>
17
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
18
+ <![endif]-->
19
+ <!--[if (gte IE 6)&(lte IE 8)]>
20
+ <script src="https://d2dfho4r6t7asi.cloudfront.net/assets/selectivizr-7b14bd1d1264beb6f8c385039c9cf80a.js" type="text/javascript"></script>
21
+ <![endif]-->
22
+ <meta content="authenticity_token" name="csrf-param" />
23
+ <meta content="DA4GeimHaeQpbsKns+X4McGZ2FvSzYsNd8T5lJF4O3SghouFn3axtcKrvpguWyZ5h4/90SNTUO62EsKI7ILDyg==" name="csrf-token" />
24
+
25
+ <link href="https://speakerdeck.com/sferik.atom" rel="alternate" title="Erik Michaels-Ober&#x27;s Presentations Feed" type="application/atom+xml" />
26
+ <meta name="octolytics-dimension-user_id" content="20744" /><meta name="octolytics-dimension-user_username" content="sferik" />
27
+
28
+ </head>
29
+ <body class="signed-out">
30
+ <header>
31
+ <div class="container">
32
+ <h1><a href="/">Speaker Deck</a></h1>
33
+
34
+ <form accept-charset="UTF-8" action="/search" id="search_form" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
35
+ <input type="text" id="q" name="q" placeholder="Search…" value="" autocomplete="off" />
36
+ <button>Search</button>
37
+ </form>
38
+ <div class="navigation">
39
+ <ul>
40
+ <li><a href="/signup">Sign Up</a></li>
41
+ <li><a href="/signin">Sign In</a></li>
42
+ </ul>
43
+
44
+
45
+ </div>
46
+
47
+
48
+ </div>
49
+ </header>
50
+
51
+
52
+ <div id="content">
53
+
54
+
55
+
56
+ <section class="light">
57
+ <div class="container">
58
+ <div class="main">
59
+
60
+
61
+
62
+ <h1>Talks by Erik Michaels-Ober</h1>
63
+ <p></p>
64
+
65
+
66
+
67
+ <div class="talks">
68
+ <div class="talk public" data-id="585245d01ee1013238737e42b879906f" data-slide-count="58">
69
+ <a class="slide_preview scrub" href="/sferik/writing-fast-ruby">
70
+ <img alt="Thumb_slide_0" src="https://speakerd.s3.amazonaws.com/presentations/585245d01ee1013238737e42b879906f/thumb_slide_0.jpg" />
71
+ <div class="scrubber"><div class="scrubbed" style="width:0;"></div></div>
72
+ </a>
73
+ <div class="talk-listing-meta">
74
+ <h3 class="title">
75
+ <a href="/sferik/writing-fast-ruby">Writing Fast Ruby</a>
76
+ </h3>
77
+ <p class="date">
78
+ Oct 13, 2014 by
79
+ <a href="/sferik">Erik Michaels-Ober</a></p>
80
+ </div>
81
+ </div>
82
+
83
+ <div class="talk public" data-id="500a42a0ac9a0131dd950ac15ed77645" data-slide-count="17">
84
+ <a class="slide_preview scrub" href="/sferik/mutation-testing-with-mutant">
85
+ <img alt="Thumb_slide_0" src="https://speakerd.s3.amazonaws.com/presentations/500a42a0ac9a0131dd950ac15ed77645/thumb_slide_0.jpg" />
86
+ <div class="scrubber"><div class="scrubbed" style="width:0;"></div></div>
87
+ </a>
88
+ <div class="talk-listing-meta">
89
+ <h3 class="title">
90
+ <a href="/sferik/mutation-testing-with-mutant">Mutation Testing with Mutant</a>
91
+ </h3>
92
+ <p class="date">
93
+ Apr 22, 2014 by
94
+ <a href="/sferik">Erik Michaels-Ober</a></p>
95
+ </div>
96
+ </div>
97
+
98
+ <div class="talk public" data-id="f69c8d90ac990131518f4a996f9256bf" data-slide-count="36">
99
+ <a class="slide_preview scrub" href="/sferik/putting-the-media-in-hypermedia">
100
+ <img alt="Thumb_slide_0" src="https://speakerd.s3.amazonaws.com/presentations/f69c8d90ac990131518f4a996f9256bf/thumb_slide_0.jpg" />
101
+ <div class="scrubber"><div class="scrubbed" style="width:0;"></div></div>
102
+ </a>
103
+ <div class="talk-listing-meta">
104
+ <h3 class="title">
105
+ <a href="/sferik/putting-the-media-in-hypermedia">Putting the “Media” in Hypermedia</a>
106
+ </h3>
107
+ <p class="date">
108
+ Mar 27, 2014 by
109
+ <a href="/sferik">Erik Michaels-Ober</a></p>
110
+ </div>
111
+ </div>
112
+
113
+ <div class="talk empty"><div class="slide_preview"></div></div>
114
+
115
+ <div class="talk empty"><div class="slide_preview"></div></div>
116
+
117
+ <div class="talk empty"><div class="slide_preview"></div></div>
118
+
119
+ <div class="talk empty"><div class="slide_preview"></div></div>
120
+
121
+ <div class="talk empty"><div class="slide_preview"></div></div>
122
+
123
+ <div class="talk empty"><div class="slide_preview"></div></div>
124
+
125
+ </div>
126
+
127
+
128
+
129
+ </div>
130
+
131
+ <div class="sidebar">
132
+ <div class="sidebar">
133
+ <h1>Speaker Details</h1>
134
+ <a href="/sferik" class="bio_mugshot"><img alt="1f74b13f1e5c6c69cb5d7fbaabb1e2cb?s=47" src="//secure.gravatar.com/avatar/1f74b13f1e5c6c69cb5d7fbaabb1e2cb?s=47" /></a>
135
+ <h2>Erik Michaels-Ober</h2>
136
+ <div class="bio"><p></p></div>
137
+
138
+ <ul class="delimited">
139
+ </ul>
140
+
141
+
142
+
143
+ </div>
144
+
145
+ </div>
146
+ </div>
147
+ </section>
148
+
149
+
150
+
151
+ </div>
152
+
153
+ <footer>
154
+ <div class="container">
155
+ <span class="copyright">
156
+ <img alt="Invertocat" src="https://d2dfho4r6t7asi.cloudfront.net/assets/invertocat-f10d7398407ff679b054b8c4c86aa639.svg" />
157
+ <div class="copyright-text">Copyright &copy; 2014 <a href="http://github.com">GitHub</a> Inc.
158
+ <div class="crumb">All slide content and descriptions are owned by their creators.</div>
159
+ </div>
160
+ </span>
161
+
162
+ <ul class="links">
163
+ <li><a href="/faq">F.A.Q.</a></li>
164
+ <li><a href="/tos">Terms of Service</a></li>
165
+ <li><a href="/privacy">Privacy Policy</a></li>
166
+ </ul>
167
+ </div>
168
+ </footer>
169
+
170
+ <script type="text/javascript">
171
+ var _gaq = _gaq || [];
172
+ _gaq.push(['_setAccount', 'UA-19290517-1']);
173
+ _gaq.push(['_setDomainName', '.speakerdeck.com']);
174
+ _gaq.push(['_trackPageview']);
175
+
176
+ (function() {
177
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
178
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
179
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
180
+ })();
181
+ </script>
182
+
183
+
184
+ <script type="text/javascript">
185
+ (function() {
186
+ var t = document.createElement('script');
187
+ t.type = 'text/javascript';
188
+ t.async = true;
189
+ t.id = 'gauges-tracker';
190
+ t.setAttribute('data-site-id',
191
+ '4dd2a2b5613f5d2021000005');
192
+ t.src = '//secure.gaug.es/track.js';
193
+ var s = document.getElementsByTagName('script')[0];
194
+ s.parentNode.insertBefore(t, s);
195
+ })();
196
+ </script>
197
+
198
+ </body>
199
+ </html>
200
+
@@ -1,3 +1,5 @@
1
+ require 'spec_helper'
2
+
1
3
  module SpeakerdeckApi
2
4
  describe Parser do
3
5
 
@@ -9,6 +11,16 @@ module SpeakerdeckApi
9
11
  doc
10
12
  end
11
13
 
14
+ let(:speaker_without_info) do
15
+ path = File.join(File.dirname(File.expand_path(__FILE__)), "../fixtures/speaker_without_info.html")
16
+ f = File.open(path)
17
+ doc = Nokogiri::XML(f)
18
+ f.close
19
+ doc
20
+ end
21
+
22
+
23
+
12
24
  context 'speakers' do
13
25
  describe '.get_speaker_details' do
14
26
  context 'valid speaker' do
@@ -39,6 +51,16 @@ module SpeakerdeckApi
39
51
 
40
52
  end
41
53
  end
54
+
55
+ context 'speaker with no info' do
56
+ it 'contains the "name" key' do
57
+ expect(subject.get_speaker_details(speaker_without_info).values_at(:name)).to eql(["Erik Michaels-Ober"])
58
+ end
59
+
60
+ it 'contains the "website" key as empty string' do
61
+ expect(subject.get_speaker_details(speaker_without_info).values_at(:website)).to eql([""])
62
+ end
63
+ end
42
64
  end
43
65
  end
44
66
  end
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: speakerdeck_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fer Perales
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-15 00:00:00.000000000 Z
11
+ date: 2014-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.7'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: nokogiri
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: pry
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: coveralls
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: pry-byebug
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  description:
@@ -115,9 +115,9 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - ".coveralls.yml"
119
- - ".gitignore"
120
- - ".travis.yml"
118
+ - .coveralls.yml
119
+ - .gitignore
120
+ - .travis.yml
121
121
  - Gemfile
122
122
  - LICENSE.txt
123
123
  - README.md
@@ -130,6 +130,7 @@ files:
130
130
  - lib/speakerdeck_api/version.rb
131
131
  - speakerdeck_api.gemspec
132
132
  - spec/fixtures/speaker_profile.html
133
+ - spec/fixtures/speaker_without_info.html
133
134
  - spec/speakerdeck_api/connection_spec.rb
134
135
  - spec/speakerdeck_api/parser_spec.rb
135
136
  - spec/speakerdeck_api/speaker_spec.rb
@@ -145,12 +146,12 @@ require_paths:
145
146
  - lib
146
147
  required_ruby_version: !ruby/object:Gem::Requirement
147
148
  requirements:
148
- - - ">="
149
+ - - '>='
149
150
  - !ruby/object:Gem::Version
150
151
  version: '0'
151
152
  required_rubygems_version: !ruby/object:Gem::Requirement
152
153
  requirements:
153
- - - ">="
154
+ - - '>='
154
155
  - !ruby/object:Gem::Version
155
156
  version: '0'
156
157
  requirements: []
@@ -161,6 +162,7 @@ specification_version: 4
161
162
  summary: A gem for getting data from speakerdeck.com
162
163
  test_files:
163
164
  - spec/fixtures/speaker_profile.html
165
+ - spec/fixtures/speaker_without_info.html
164
166
  - spec/speakerdeck_api/connection_spec.rb
165
167
  - spec/speakerdeck_api/parser_spec.rb
166
168
  - spec/speakerdeck_api/speaker_spec.rb