lanyrd 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +3 -0
- data/LICENSE +20 -0
- data/Rakefile +7 -0
- data/Readme.md +24 -0
- data/lanyrd.gemspec +23 -0
- data/lib/lanyrd/client.rb +37 -0
- data/lib/lanyrd/version.rb +3 -0
- data/lib/lanyrd.rb +4 -0
- data/spec/client_spec.rb +30 -0
- data/spec/spec_helper.rb +3 -0
- metadata +102 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Andrew Nesbitt
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
data/Readme.md
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# Lanyrd
|
2
|
+
|
3
|
+
Wrapper around the Lanyrd iOS client api.
|
4
|
+
|
5
|
+
## Development
|
6
|
+
|
7
|
+
Source hosted at [GitHub](http://github.com/andrew/lanyrd).
|
8
|
+
Report Issues/Feature requests on [GitHub Issues](http://github.com/andrew/lanyrd/issues).
|
9
|
+
|
10
|
+
Tests can be ran with `rake spec`
|
11
|
+
|
12
|
+
### Note on Patches/Pull Requests
|
13
|
+
|
14
|
+
* Fork the project.
|
15
|
+
* Make your feature addition or bug fix.
|
16
|
+
* Add tests for it. This is important so I don't break it in a
|
17
|
+
future version unintentionally.
|
18
|
+
* Commit, do not mess with rakefile, version, or history.
|
19
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
20
|
+
* Send me a pull request. Bonus points for topic branches.
|
21
|
+
|
22
|
+
## Copyright
|
23
|
+
|
24
|
+
Copyright (c) 2011 Andrew Nesbitt. See [LICENSE](https://github.com/andrew/lanyrd/blob/master/LICENSE) for details.
|
data/lanyrd.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/lanyrd/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Andrew Nesbitt"]
|
6
|
+
gem.email = ["andrewnez@gmail.com"]
|
7
|
+
gem.description = %q{Ruby wrapper for the Lanyrd API}
|
8
|
+
gem.summary = %q{Ruby wrapper for the Lanyrd API}
|
9
|
+
gem.homepage = "http://github.com/andrew/lanyrd"
|
10
|
+
|
11
|
+
gem.add_dependency 'faraday', '~> 0.7'
|
12
|
+
gem.add_dependency 'CFPropertyList'
|
13
|
+
|
14
|
+
gem.add_development_dependency 'bundler', '~> 1.0'
|
15
|
+
gem.add_development_dependency 'rspec', '~> 2.6'
|
16
|
+
|
17
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
|
+
gem.files = `git ls-files`.split("\n")
|
19
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
20
|
+
gem.name = "lanyrd"
|
21
|
+
gem.require_paths = ["lib"]
|
22
|
+
gem.version = Lanyrd::VERSION
|
23
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Lanyrd
|
2
|
+
class Client
|
3
|
+
def search(query)
|
4
|
+
get "search/?q=#{query}"
|
5
|
+
end
|
6
|
+
|
7
|
+
def popular
|
8
|
+
get "popular/"
|
9
|
+
end
|
10
|
+
|
11
|
+
def event(id)
|
12
|
+
get "event/#{id}/"
|
13
|
+
end
|
14
|
+
|
15
|
+
def speakers(event_id)
|
16
|
+
get "speakers/#{event_id}/"
|
17
|
+
end
|
18
|
+
|
19
|
+
def attendees(event_id)
|
20
|
+
get "attendees/#{event_id}/"
|
21
|
+
end
|
22
|
+
|
23
|
+
def get(path)
|
24
|
+
response = conenction.get path
|
25
|
+
decode response.body
|
26
|
+
end
|
27
|
+
|
28
|
+
def decode(data)
|
29
|
+
plist = CFPropertyList::List.new(:data => data)
|
30
|
+
CFPropertyList.native_types(plist.value)
|
31
|
+
end
|
32
|
+
|
33
|
+
def conenction
|
34
|
+
Faraday.new(:url => 'http://lanyrd.com/mobile/ios/')
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/lanyrd.rb
ADDED
data/spec/client_spec.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'lanyrd'
|
3
|
+
|
4
|
+
describe Lanyrd::Client do
|
5
|
+
before(:each) { @lanyrd = Lanyrd::Client.new }
|
6
|
+
|
7
|
+
it "should search lanyrd" do
|
8
|
+
@lanyrd.search('ruby').should be_an_instance_of Hash
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should return popular events" do
|
12
|
+
@lanyrd.popular.should be_an_instance_of Hash
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should return popular events" do
|
16
|
+
@lanyrd.popular.should be_an_instance_of Hash
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should return event information" do
|
20
|
+
@lanyrd.event('cfdbd').should be_an_instance_of Hash
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should return speakers for an event" do
|
24
|
+
@lanyrd.speakers('cfdbd').should be_an_instance_of Hash
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should return attendees for an event" do
|
28
|
+
@lanyrd.attendees('cfdbd').should be_an_instance_of Hash
|
29
|
+
end
|
30
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lanyrd
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Andrew Nesbitt
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-10-30 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: faraday
|
16
|
+
requirement: &70112406675760 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0.7'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70112406675760
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: CFPropertyList
|
27
|
+
requirement: &70112406675060 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70112406675060
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: bundler
|
38
|
+
requirement: &70112406673580 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '1.0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70112406673580
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rspec
|
49
|
+
requirement: &70112406672380 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.6'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70112406672380
|
58
|
+
description: Ruby wrapper for the Lanyrd API
|
59
|
+
email:
|
60
|
+
- andrewnez@gmail.com
|
61
|
+
executables: []
|
62
|
+
extensions: []
|
63
|
+
extra_rdoc_files: []
|
64
|
+
files:
|
65
|
+
- .gitignore
|
66
|
+
- Gemfile
|
67
|
+
- LICENSE
|
68
|
+
- Rakefile
|
69
|
+
- Readme.md
|
70
|
+
- lanyrd.gemspec
|
71
|
+
- lib/lanyrd.rb
|
72
|
+
- lib/lanyrd/client.rb
|
73
|
+
- lib/lanyrd/version.rb
|
74
|
+
- spec/client_spec.rb
|
75
|
+
- spec/spec_helper.rb
|
76
|
+
homepage: http://github.com/andrew/lanyrd
|
77
|
+
licenses: []
|
78
|
+
post_install_message:
|
79
|
+
rdoc_options: []
|
80
|
+
require_paths:
|
81
|
+
- lib
|
82
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
requirements: []
|
95
|
+
rubyforge_project:
|
96
|
+
rubygems_version: 1.8.6
|
97
|
+
signing_key:
|
98
|
+
specification_version: 3
|
99
|
+
summary: Ruby wrapper for the Lanyrd API
|
100
|
+
test_files:
|
101
|
+
- spec/client_spec.rb
|
102
|
+
- spec/spec_helper.rb
|