meetup_client_rails 0.1.0
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 +15 -0
- data/.gitignore +11 -0
- data/.travis.yml +13 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +21 -0
- data/README.md +72 -0
- data/Rakefile +7 -0
- data/bin/console +10 -0
- data/bin/setup +8 -0
- data/lib/generators/meetup_client_rails/install_generator.rb +12 -0
- data/lib/generators/meetup_client_rails/templates/meetup_client_rails.rb +3 -0
- data/lib/meetup_client_rails/api_callers/http_request.rb +38 -0
- data/lib/meetup_client_rails/api_callers/http_requester.rb +15 -0
- data/lib/meetup_client_rails/configuration.rb +5 -0
- data/lib/meetup_client_rails/events.rb +19 -0
- data/lib/meetup_client_rails/groups.rb +10 -0
- data/lib/meetup_client_rails/models/event.rb +25 -0
- data/lib/meetup_client_rails/models/group.rb +37 -0
- data/lib/meetup_client_rails/models/photo.rb +23 -0
- data/lib/meetup_client_rails/models/photo_album.rb +21 -0
- data/lib/meetup_client_rails/models/venue.rb +26 -0
- data/lib/meetup_client_rails/photos.rb +28 -0
- data/lib/meetup_client_rails/venues.rb +12 -0
- data/lib/meetup_client_rails/version.rb +3 -0
- data/lib/meetup_client_rails.rb +42 -0
- data/meetup_client_rails.gemspec +25 -0
- metadata +70 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YWYxZDFlZDZmZWQwZmE2NTMzNjM4N2U2YTVkMzJiZTU5NDUzZjU0Ng==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
OTE3OWY3ZmYxZGRiMTNhYTVhZmMwYTUxNDFjYmUzZTc3ODAxNzAzMg==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YzY4YTU4ZTU4NjYwZDAxZDk0MWFhOWQxNDUxNjk5MDM4NTYzODM4OTc4NmUz
|
10
|
+
ODVmODUxOTc5ODc3MDBmNTVkNjZiMTM4NzZiYzJiOWM1ODA2ZjMwNDNmNmZl
|
11
|
+
MWJlNzBmYzZlYWQ0MWVhNWY3NWZhMjZlZjU3NjUxZDQ2MDUyY2E=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MzMxNTIxNzlhNjExZWFiZjJlNmM4OGZjMjNjNTM1N2NkNWM0M2JlM2U0M2Rk
|
14
|
+
NjBjOTM2ZDM5YTY1ZjBiZDE0MWQ3NWI2ZTU5ZTY1YzgzMWU5ODI4OTVkZmQ5
|
15
|
+
OWY0YWNiMmY0MDMyMjJmZTU0NTMwMGU5M2JlMmEwMTE1MDAyMzg=
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
language: ruby
|
2
|
+
cache: bundler
|
3
|
+
sudo: false
|
4
|
+
rvm:
|
5
|
+
- 2.3.1
|
6
|
+
- 2.2.5
|
7
|
+
|
8
|
+
deploy:
|
9
|
+
provider: rubygems
|
10
|
+
api_key:
|
11
|
+
secure: Gr3KVz4O7gXKQKCC6kSfyAxv6EHq04R28T4KdLXtm5BpHoMaj7dM2mt3ytdyJuVMBTtBObgowOLgw0FHCzajTrKNTmTlwg0FtUNyVw9SM88QOyN3sI81vTuTtluLlkKPr5jt3DP8qU4IcXbxyFdgf4HIM4HTbrG0D5CF7byCKw6T7ikSCQ4YxymHDqfgIkaFRU38rJyoEYzB5hlATZMR+3RQMwD3mUI1KEBb9i9CL7WE0qKLpcs1XG+s3WeX6xaOshQBma3JA5NT0mAJYfTVunm62yjiz7T+bDOIuCSh+700Puw+XLqAJEWDj9CpnqlL++1XPafwwpTxjHlPqLlhu/jbBsMRHNl9uXLqTdMYVyK1A/4i8Z+BPdEW8RsN57wTCUCcbTdifiQb4dV6oDi0Cqxv8AGGDhOmYDUjP6wy90lLw7v/yp5Ls0z2W58yh/89TdUp2LCHjGAQTXF9nrPIH75pZO47hxVxHGZhrySRc0jniCsXWrtDDrE1MAhlB0YfK+APxxiJjMBck9aAi3q+6px1KM6vJI/p/EVmQKbL3oKEWaeHc/7mcJkgxD5/5so91zleqFxB+JUdhFc2e+c39EJw8NFuCn3J57UmoXpjkwI8T60yTBdb25L6nTVRKMjGF9gbDoDseCKZAqwcqPlPCEBftblw/iwqKzaNFU2BQuw=
|
12
|
+
on:
|
13
|
+
tags: true
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 martinechtner
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
# MeetupClientRails [](https://travis-ci.org/martinechtner/meetup_client_rails)
|
2
|
+
|
3
|
+
Meetup Client to connect with the meetup API based on https://github.com/cranieri/meetup_client
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'meetup_client_rails'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
```console
|
16
|
+
$ bundle install
|
17
|
+
```
|
18
|
+
Run the bundle command to install it.
|
19
|
+
|
20
|
+
Next, you need to run the generator:
|
21
|
+
|
22
|
+
```console
|
23
|
+
$ rails generate meetup_client_rails:install
|
24
|
+
```
|
25
|
+
|
26
|
+
Then edit the generator to add your Meetup Api Key you can get one [here](https://secure.meetup.com/meetup_api/key/)
|
27
|
+
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
This gem works with v3 of the meetup api, not everything has been implemented but the gem is easy to add on to.
|
31
|
+
|
32
|
+
You can get a list of params from the [Meetup API](http://www.meetup.com/meetup_api/docs/)
|
33
|
+
|
34
|
+
Example Meetup url http://www.meetup.com/MEETUP_GROUP/
|
35
|
+
|
36
|
+
Events
|
37
|
+
```ruby
|
38
|
+
MeetupClientRails::Events.all(MEETUP_GROUP, { page: 20 })
|
39
|
+
MeetupClientRails::Events.find(MEETUP_GROUP, id_123, { page: 20 })
|
40
|
+
```
|
41
|
+
|
42
|
+
Groups
|
43
|
+
```ruby
|
44
|
+
MeetupClientRails::Groups.find(MEETUP_GROUP, id_123, { page: 20 })
|
45
|
+
```
|
46
|
+
Photos
|
47
|
+
```ruby
|
48
|
+
MeetupClientRails::Photos.all_photo_albums(MEETUP_GROUP, { page: 20 })
|
49
|
+
MeetupClientRails::Photos.find_photo_album(MEETUP_GROUP, id_123, { page: 20 })
|
50
|
+
MeetupClientRails::Photos.all_photos(MEETUP_GROUP, { page: 20 })
|
51
|
+
```
|
52
|
+
|
53
|
+
Venues
|
54
|
+
```ruby
|
55
|
+
MeetupClientRails::Venues.all(MEETUP_GROUP, { page: 20 })
|
56
|
+
```
|
57
|
+
|
58
|
+
## Development
|
59
|
+
|
60
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
61
|
+
|
62
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
63
|
+
|
64
|
+
## Contributing
|
65
|
+
|
66
|
+
Bug reports and pull requests are welcome on GitHub.
|
67
|
+
|
68
|
+
|
69
|
+
## License
|
70
|
+
|
71
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
72
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'meetup_client_rails'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
require 'irb'
|
10
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
module MeetupClientRails
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
4
|
+
source_root File.expand_path('../templates', __FILE__)
|
5
|
+
desc 'This generator creates an initializer file at config/initializers'
|
6
|
+
|
7
|
+
def add_initializer
|
8
|
+
template 'meetup_client_rails.rb', 'config/initializers/meetup_client_rails.rb'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
module MeetupClientRails
|
4
|
+
module ApiCallers
|
5
|
+
class HttpRequest
|
6
|
+
CHARSET = 'UTF-8'
|
7
|
+
|
8
|
+
def initialize(uri, method = 'get')
|
9
|
+
@in_uri = uri
|
10
|
+
@method = method
|
11
|
+
end
|
12
|
+
|
13
|
+
def make_request
|
14
|
+
uri = URI.parse(@in_uri)
|
15
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
16
|
+
response = http.request(class_to_call.new(uri.request_uri, headers))
|
17
|
+
format_response(response)
|
18
|
+
end
|
19
|
+
|
20
|
+
def format_response(response)
|
21
|
+
json = {}
|
22
|
+
json['body'] = JSON.parse(response.body)
|
23
|
+
json['headers'] = response.to_hash
|
24
|
+
json
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def headers
|
30
|
+
{ 'Accept-Charset' => CHARSET }
|
31
|
+
end
|
32
|
+
|
33
|
+
def class_to_call
|
34
|
+
Net::HTTP.const_get(@method.capitalize)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module MeetupClientRails
|
2
|
+
class Events
|
3
|
+
def self.all(urlname, params = {})
|
4
|
+
params = MeetupClientRails.query_string(MeetupClientRails.merge_api_key(params))
|
5
|
+
events_json = MeetupClientRails.get_response("#{urlname}/events?#{params}")
|
6
|
+
|
7
|
+
events_json['body'].collect do |event|
|
8
|
+
MeetupClientRails::Model::Event.new(event)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.find(urlname, id, params = {})
|
13
|
+
params = MeetupClientRails.query_string(MeetupClientRails.merge_api_key(params))
|
14
|
+
event_json = MeetupClientRails.get_response("#{urlname}/events/#{id}?#{params}")
|
15
|
+
|
16
|
+
MeetupClientRails::Model::Event.new(event_json['body'])
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module MeetupClientRails
|
2
|
+
class Groups
|
3
|
+
def self.find(urlname, params = {})
|
4
|
+
params = MeetupClientRails.query_string(MeetupClientRails.merge_api_key(params))
|
5
|
+
group_json = MeetupClientRails.get_response("#{urlname}?#{params}")
|
6
|
+
|
7
|
+
MeetupClientRails::Model::Group.new(group_json['body'])
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module MeetupClientRails
|
2
|
+
module Model
|
3
|
+
class Event
|
4
|
+
attr_accessor :created, :id, :name, :status, :time, :updated, :utc_offset, :waitlist_count,
|
5
|
+
:yes_rsvp_count, :venue, :group, :link, :description, :visibility
|
6
|
+
|
7
|
+
def initialize(json_response = {})
|
8
|
+
@created = json_response['created']
|
9
|
+
@id = json_response['id']
|
10
|
+
@name = json_response['name']
|
11
|
+
@status = json_response['status']
|
12
|
+
@time = json_response['time']
|
13
|
+
@updated = json_response['updated']
|
14
|
+
@utc_offset = json_response['utc_offset']
|
15
|
+
@waitlist_count = json_response['waitlist_count']
|
16
|
+
@yes_rsvp_count = json_response['yes_rsvp_count']
|
17
|
+
@venue = json_response['venue']
|
18
|
+
@group = json_response['group']
|
19
|
+
@link = json_response['link']
|
20
|
+
@description = json_response['description']
|
21
|
+
@visibility = json_response['visibility']
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module MeetupClientRails
|
2
|
+
module Model
|
3
|
+
class Group
|
4
|
+
attr_accessor :id, :name, :link, :time, :urlname, :description, :created,
|
5
|
+
:city, :country, :localized_country_name, :state, :join_mode, :lat, :lon,
|
6
|
+
:members, :organizer, :who, :group_photo, :key_photo, :timezone, :next_event,
|
7
|
+
:category, :photos
|
8
|
+
|
9
|
+
def initialize(json_response)
|
10
|
+
@id = json_response['id']
|
11
|
+
@name = json_response['name']
|
12
|
+
@link = json_response['link']
|
13
|
+
@time = json_response['time']
|
14
|
+
@urlname = json_response['urlname']
|
15
|
+
@description = json_response['description']
|
16
|
+
@created = json_response['created']
|
17
|
+
@city = json_response['city']
|
18
|
+
@country = json_response['country']
|
19
|
+
@localized_country_name = json_response['localized_country_name']
|
20
|
+
@state = json_response['state']
|
21
|
+
@join_mode = json_response['join_mode']
|
22
|
+
@visibility = json_response['visibility']
|
23
|
+
@lat = json_response['lat']
|
24
|
+
@lon = json_response['lon']
|
25
|
+
@members = json_response['members']
|
26
|
+
@organizer = json_response['organizer']
|
27
|
+
@who = json_response['who']
|
28
|
+
@timezone = json_response['timezone']
|
29
|
+
@next_event = json_response['next_event']
|
30
|
+
@category = json_response['category']
|
31
|
+
@group_photo = json_response['group_photo']
|
32
|
+
@key_photo = json_response['key_photo']
|
33
|
+
@photos = json_response['photos']
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module MeetupClientRails
|
2
|
+
module Model
|
3
|
+
class Photo
|
4
|
+
attr_accessor :id, :highres_link, :photo_link, :thumb_link, :type, :base_url, :link, :created,
|
5
|
+
:updated, :utc_offset, :member, :photo_album
|
6
|
+
|
7
|
+
def initialize(json_response = {})
|
8
|
+
@id = json_response['id']
|
9
|
+
@highres_link= json_response['highres_link']
|
10
|
+
@photo_link = json_response['photo_link']
|
11
|
+
@thumb_link = json_response['thumb_link']
|
12
|
+
@type = json_response['type']
|
13
|
+
@base_url = json_response['base_url']
|
14
|
+
@link = json_response['link']
|
15
|
+
@created = json_response['created']
|
16
|
+
@updated = json_response['updated']
|
17
|
+
@utc_offset = json_response['utc_offset']
|
18
|
+
@member = json_response['member']
|
19
|
+
@photo_album = json_response['photo_album']
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module MeetupClientRails
|
2
|
+
module Model
|
3
|
+
class PhotoAlbum
|
4
|
+
attr_accessor :id, :title, :photo_count, :event, :photo_sample, :link, :created,
|
5
|
+
:updated, :group, :album_photo
|
6
|
+
|
7
|
+
def initialize(json_response = {})
|
8
|
+
@id = json_response['id']
|
9
|
+
@title = json_response['title']
|
10
|
+
@photo_count = json_response['photo_count']
|
11
|
+
@event = json_response['event']
|
12
|
+
@photo_sample = json_response['photo_sample']
|
13
|
+
@link = json_response['link']
|
14
|
+
@created = json_response['created']
|
15
|
+
@updated = json_response['updated']
|
16
|
+
@group = json_response['group']
|
17
|
+
@album_photo = json_response['album_photo']
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module MeetupClientRails
|
2
|
+
module Model
|
3
|
+
class Venue
|
4
|
+
attr_accessor :id, :visibility, :zip, :state, :phone, :time, :name, :lon, :lat,
|
5
|
+
:localized_country_name, :country, :city, :address_1, :address_2
|
6
|
+
|
7
|
+
def initialize(json_response = {})
|
8
|
+
@id = json_response['id']
|
9
|
+
@visibility = json_response['visibility']
|
10
|
+
@zip = json_response['zip']
|
11
|
+
@state = json_response['state']
|
12
|
+
@phone = json_response['phone']
|
13
|
+
@name = json_response['name']
|
14
|
+
@lon = json_response['lon']
|
15
|
+
@lat = json_response['lat']
|
16
|
+
@time = json_response['time']
|
17
|
+
@localized_country_name = json_response['localized_country_name']
|
18
|
+
@country = json_response['country']
|
19
|
+
@city = json_response['city']
|
20
|
+
@address_1 = json_response['address_1']
|
21
|
+
@address_2 = json_response['address_2']
|
22
|
+
@address_3 = json_response['address_3']
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module MeetupClientRails
|
2
|
+
class Photos
|
3
|
+
def self.all_photo_albums(urlname, params = {})
|
4
|
+
params = MeetupClientRails.query_string(MeetupClientRails.merge_api_key(params))
|
5
|
+
photo_albums_json = MeetupClientRails.get_response("#{urlname}/photo_albums?#{params}")
|
6
|
+
|
7
|
+
photo_albums_json['body'].collect do |photo_album|
|
8
|
+
MeetupClientRails::Model::PhotoAlbum.new(photo_album)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.find_photo_album(urlname, id, params = {})
|
13
|
+
params = MeetupClientRails.query_string(MeetupClientRails.merge_api_key(params))
|
14
|
+
photo_album_json = MeetupClientRails.get_response("#{urlname}/photo_albums/#{id}?#{params}")
|
15
|
+
|
16
|
+
MeetupClientRails::Model::PhotoAlbum.new(photo_album_json['body'])
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.all_photos(urlname, params = {})
|
20
|
+
params = MeetupClientRails.query_string(MeetupClientRails.merge_api_key(params))
|
21
|
+
photos_json = MeetupClientRails.get_response("#{urlname}/photos?#{params}")
|
22
|
+
|
23
|
+
photos_json['body'].collect do |photo|
|
24
|
+
MeetupClientRails::Model::Photo.new(photo)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module MeetupClientRails
|
2
|
+
class Venues
|
3
|
+
def self.all(urlname, params = {})
|
4
|
+
params = MeetupClientRails.query_string(MeetupClientRails.merge_api_key(params))
|
5
|
+
venues_json = MeetupClientRails.get_response("#{urlname}/venues?#{params}")
|
6
|
+
|
7
|
+
venues_json['body'].collect do |venue|
|
8
|
+
MeetupClientRails::Model::Venue.new(venue)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'meetup_client_rails/version'
|
2
|
+
require 'meetup_client_rails/configuration'
|
3
|
+
require 'meetup_client_rails/api_callers/http_request'
|
4
|
+
require 'meetup_client_rails/api_callers/http_requester'
|
5
|
+
|
6
|
+
require 'meetup_client_rails/events'
|
7
|
+
require 'meetup_client_rails/groups'
|
8
|
+
require 'meetup_client_rails/photos'
|
9
|
+
require 'meetup_client_rails/venues'
|
10
|
+
require 'meetup_client_rails/models/event'
|
11
|
+
require 'meetup_client_rails/models/group'
|
12
|
+
require 'meetup_client_rails/models/photo'
|
13
|
+
require 'meetup_client_rails/models/photo_album'
|
14
|
+
require 'meetup_client_rails/models/venue'
|
15
|
+
|
16
|
+
module MeetupClientRails
|
17
|
+
BASE_URL = 'http://api.meetup.com/'
|
18
|
+
|
19
|
+
class << self
|
20
|
+
def configure(&block)
|
21
|
+
yield @config ||= MeetupClientRails::Configuration.new
|
22
|
+
end
|
23
|
+
|
24
|
+
def config
|
25
|
+
@config
|
26
|
+
end
|
27
|
+
|
28
|
+
def get_response(request_string)
|
29
|
+
request = MeetupClientRails::ApiCallers::HttpRequest.new("#{BASE_URL}#{request_string}")
|
30
|
+
requester = MeetupClientRails::ApiCallers::HttpRequester.new(request)
|
31
|
+
requester.execute_request
|
32
|
+
end
|
33
|
+
|
34
|
+
def merge_api_key(params)
|
35
|
+
params.merge({ key: ::MeetupClientRails.config.api_key })
|
36
|
+
end
|
37
|
+
|
38
|
+
def query_string(params)
|
39
|
+
params.map { |k, v| "#{k}=#{v}" }.join('&')
|
40
|
+
end
|
41
|
+
end
|
42
|
+
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 'meetup_client_rails/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'meetup_client_rails'
|
8
|
+
spec.version = MeetupClientRails::VERSION
|
9
|
+
spec.authors = ['martinechtner']
|
10
|
+
spec.email = ['martin.echtner@gmail.com']
|
11
|
+
|
12
|
+
spec.summary = %q{Meetup.com API Client}
|
13
|
+
spec.homepage = ''
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
# spec.files = Dir['{bin/*,lib/**/*,spec/**/*}'] + %w(meetup_client_rails.gemspec Rakefile README.md)
|
19
|
+
|
20
|
+
spec.bindir = 'exe'
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = %w(lib spec)
|
23
|
+
|
24
|
+
spec.required_ruby_version = '>= 2.0'
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: meetup_client_rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- martinechtner
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-10-07 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email:
|
15
|
+
- martin.echtner@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- .gitignore
|
21
|
+
- .travis.yml
|
22
|
+
- Gemfile
|
23
|
+
- LICENSE.txt
|
24
|
+
- README.md
|
25
|
+
- Rakefile
|
26
|
+
- bin/console
|
27
|
+
- bin/setup
|
28
|
+
- lib/generators/meetup_client_rails/install_generator.rb
|
29
|
+
- lib/generators/meetup_client_rails/templates/meetup_client_rails.rb
|
30
|
+
- lib/meetup_client_rails.rb
|
31
|
+
- lib/meetup_client_rails/api_callers/http_request.rb
|
32
|
+
- lib/meetup_client_rails/api_callers/http_requester.rb
|
33
|
+
- lib/meetup_client_rails/configuration.rb
|
34
|
+
- lib/meetup_client_rails/events.rb
|
35
|
+
- lib/meetup_client_rails/groups.rb
|
36
|
+
- lib/meetup_client_rails/models/event.rb
|
37
|
+
- lib/meetup_client_rails/models/group.rb
|
38
|
+
- lib/meetup_client_rails/models/photo.rb
|
39
|
+
- lib/meetup_client_rails/models/photo_album.rb
|
40
|
+
- lib/meetup_client_rails/models/venue.rb
|
41
|
+
- lib/meetup_client_rails/photos.rb
|
42
|
+
- lib/meetup_client_rails/venues.rb
|
43
|
+
- lib/meetup_client_rails/version.rb
|
44
|
+
- meetup_client_rails.gemspec
|
45
|
+
homepage: ''
|
46
|
+
licenses:
|
47
|
+
- MIT
|
48
|
+
metadata: {}
|
49
|
+
post_install_message:
|
50
|
+
rdoc_options: []
|
51
|
+
require_paths:
|
52
|
+
- lib
|
53
|
+
- spec
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '2.0'
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
requirements: []
|
65
|
+
rubyforge_project:
|
66
|
+
rubygems_version: 2.4.5
|
67
|
+
signing_key:
|
68
|
+
specification_version: 4
|
69
|
+
summary: Meetup.com API Client
|
70
|
+
test_files: []
|