almanack 1.1.5 → 1.2.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 +4 -4
- checksums.yaml.gz.sig +1 -3
- data.tar.gz.sig +0 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -8
- data/almanack.gemspec +1 -1
- data/app.json +2 -10
- data/checksums/almanack-1.1.5.gem.sha256 +1 -0
- data/checksums/almanack-1.1.5.gem.sha512 +1 -0
- data/lib/almanack.rb +0 -1
- data/lib/almanack/configuration.rb +1 -1
- data/lib/almanack/version.rb +1 -1
- data/templates/new/config.ru.tt +0 -4
- metadata +4 -3
- metadata.gz.sig +0 -0
- data/lib/almanack/event_source/meetup_group.rb +0 -129
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 496b67de75b42507bf08fec988d5eaccf26d4dfa7fee4232bdf16daf058f5b33
|
4
|
+
data.tar.gz: 7c9a6be3cbe1cb94be79ecccbf5ba8f31c3f017433de545502b5770d3d594260
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91bce6c336dee09a859086bff2a11d1a6083918db0fff67c109690da8ea4fb4fad9ff1dc7396f7e38ab21671716f7b1d97628b4ad1d0c3a09059d79cac859b18
|
7
|
+
data.tar.gz: 00bf2e37d9c258ecbeec1b02db98b70a639f6f2a7f031270510351dc83dd0703b4bb4db72b882817347112560560c606c123aaaf8ceff9d45b005c59e9860ae2
|
checksums.yaml.gz.sig
CHANGED
@@ -1,3 +1 @@
|
|
1
|
-
�
|
2
|
-
E(����8��x���G����+�S��p����}Q�4��r��A.\a ����juqXOwb��
|
3
|
-
��9�������훟�B��ODI���S����\�i������ԇު��T}�4����2��)h�����1.���3C�¤�ܼ�9K��A��-&\��,�8T%Q�M�̑�-E�G�d�>�Ѫ�З��^���8�@5&j5��R�wS]��Z����#���y,�!�!�`O���d63X�z`�H�A:ŋ�����z��&�@N��`-�]iD�iIc�B�'<q�8�.�a�#�Pn� K��*qˤ�A�Zh��4���y#uo�:�0���g4��4Ԛ�-]��/L��G�
|
1
|
+
y2��9�"�F!uP@��r�<���7KPt�T,��X�oYh>Ģ5qAVV�R�����#��J���H�^��v�={��T.`/�.��K����7�����?cًa&�x�\�lK�}=��t�G��Su=��.F�R�&N�xs��a�=Gz��Z���i�Z��Z��C�{r�v�,!�9�s.[?�g6}���\�`PN��C��7�-M�e�+��y����N�&SB@ޣ(W���K�ߓ��8Rǒs���B,�?D�5@m4��G�BnX8U������I���m�X�\ۦ�z9X���O�BB�Э��e��8�'�3�J�ӜZ��~�����J���I�i-,���4�:���ʵ
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
[](http://badge.fury.io/rb/almanack)
|
5
5
|
[](https://heroku.com/deploy?template=https://github.com/Aupajo/almanack/tree/heroku-button)
|
6
6
|
|
7
|
-
A calendar that combines events from different sources (such as Google Calendar
|
7
|
+
A calendar that combines events from different sources (such as Google Calendar and iCal feeds), and can be hosted for free on [Heroku](http://heroku.com).
|
8
8
|
|
9
9
|

|
10
10
|
|
@@ -14,7 +14,7 @@ See a demo running at [http://chch-events.herokuapp.com/](http://chch-events.her
|
|
14
14
|
|
15
15
|
* Aggregate multiple calendars together into one stream
|
16
16
|
* Supports iCal feeds (incuding Google Calendars)
|
17
|
-
* Supports Meetup.com groups
|
17
|
+
* ~Supports Meetup.com groups~ (see https://github.com/Aupajo/almanack/issues/36)
|
18
18
|
* Just supply a hash to create any arbitrary event
|
19
19
|
* Supports being freely hosted on Heroku
|
20
20
|
* 100% customisable themes with Sass and CoffeeScript support
|
@@ -67,7 +67,7 @@ By default, your calendar will run on http://localhost:9292.
|
|
67
67
|
|
68
68
|
## Configuration
|
69
69
|
|
70
|
-
See examples inside `config.ru` for iCal feeds,
|
70
|
+
See examples inside `config.ru` for iCal feeds, or static events.
|
71
71
|
|
72
72
|
```ruby
|
73
73
|
Almanack.config do |config|
|
@@ -81,14 +81,9 @@ Almanack.config do |config|
|
|
81
81
|
|
82
82
|
# Include a downloaded iCal
|
83
83
|
config.add_ical Pathname('downloaded-calendar.ical')
|
84
|
-
|
85
|
-
# Include Meetup events
|
86
|
-
config.add_meetup_group group_urlname: 'Christchurch-Ruby-Group', key: 'mysecretkey'
|
87
84
|
end
|
88
85
|
```
|
89
86
|
|
90
|
-
**Note:** You'll need your [Meetup.com API key](https://secure.meetup.com/meetup_api/key) to use Meetup.
|
91
|
-
|
92
87
|
### Time zone
|
93
88
|
|
94
89
|
To set your time zone, set your system's `TZ` environment variable.
|
data/almanack.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Almanack::VERSION
|
9
9
|
spec.authors = ["Pete Nicholls"]
|
10
10
|
spec.email = ["aupajo@gmail.com"]
|
11
|
-
spec.summary = %q{Combined events calendar for Google Calendar, iCal,
|
11
|
+
spec.summary = %q{Combined events calendar for Google Calendar, iCal, and friends.}
|
12
12
|
spec.homepage = Almanack::HOMEPAGE
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
data/app.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "Almanack",
|
3
3
|
"description": "Combine iCal, Google Calendar, and Meetup.com events into a single calendar with a public website and calendar subscription feed.",
|
4
4
|
"repository": "https://github.com/Aupajo/almanack",
|
5
|
-
"keywords": ["calendar", "events", "
|
5
|
+
"keywords": ["calendar", "events", "gcal" , "ical", "web", "feed", "rss"],
|
6
6
|
"buildpacks": [
|
7
7
|
{ "url": "heroku/ruby" }
|
8
8
|
],
|
@@ -20,16 +20,8 @@
|
|
20
20
|
"description": "An optional list of iCal feed URLs separated by spaces. For Google Calendars, look for the “address in iCal format” URLs in the calendar's settings.",
|
21
21
|
"required": false
|
22
22
|
},
|
23
|
-
"MEETUP_COM_GROUPS": {
|
24
|
-
"description": "An optional list of Meetup.com groups to subscribe to, separated by spaces. A group can be the full URL (e.g. `https://www.meetup.com/Christchurch-Ruby-Group/`) or the URL slug (e.g. `Christchurch-Ruby-Group`). Requires MEETUP_COM_API_KEYS also be set.",
|
25
|
-
"required": false
|
26
|
-
},
|
27
|
-
"MEETUP_COM_API_KEYS": {
|
28
|
-
"description": "If retrieving events from Meetup.com, you need to specify one or more API keys to use. You can find your API key at https://secure.meetup.com/meetup_api/key. If you have a lot of groups, use multiple API keys to avoid hitting API request limits separated by spaces.",
|
29
|
-
"required": false
|
30
|
-
},
|
31
23
|
"CACHE_DURATION_IN_SECONDS": {
|
32
|
-
"description": "How long to keep calendar events cached for. Set to `0` to always show an up-to-date calendar
|
24
|
+
"description": "How long to keep calendar events cached for. Set to `0` to always show an up-to-date calendar.",
|
33
25
|
"value": "900"
|
34
26
|
},
|
35
27
|
"DAYS_LOOKAHEAD": {
|
@@ -0,0 +1 @@
|
|
1
|
+
3d267c6f652968bf5184b57bcf50dd7898b07f5ca7fbfcc5ee1c3b12eb705670
|
@@ -0,0 +1 @@
|
|
1
|
+
16041fb8e3be78094936c8740eddd05568135f51dcde0fc991f2818d81235464d53bc0fc7e474e5af327777a6dc464fea05d0e6993b3baace9bd382ec696b039
|
data/lib/almanack.rb
CHANGED
@@ -17,6 +17,5 @@ require "almanack/representation/ical_feed"
|
|
17
17
|
require "almanack/representation/json_feed"
|
18
18
|
require "almanack/event"
|
19
19
|
require "almanack/event_source/static"
|
20
|
-
require "almanack/event_source/meetup_group"
|
21
20
|
require "almanack/event_source/ical"
|
22
21
|
require "almanack/event_source/ical_feed"
|
@@ -67,7 +67,7 @@ module Almanack
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def add_meetup_group(options)
|
70
|
-
|
70
|
+
fail "Unfortunately, due to Meetup's changes to their API, this integration is no longer supported. See https://github.com/Aupajo/almanack/issues/36 for more information."
|
71
71
|
end
|
72
72
|
|
73
73
|
def cache_store
|
data/lib/almanack/version.rb
CHANGED
data/templates/new/config.ru.tt
CHANGED
@@ -9,10 +9,6 @@ Almanack.config do |c|
|
|
9
9
|
c.cache_responses = true
|
10
10
|
c.cache_expiry = 900 # seconds
|
11
11
|
|
12
|
-
# Your group's URL name is what you'd find at www.meetup.com/Your-Group-URL-Name/
|
13
|
-
# You can get a Meetup API key from https://secure.meetup.com/meetup_api/key
|
14
|
-
# c.add_meetup_group group_urlname: 'Christchurch-Ruby-Group', key: 'mysecretkey'
|
15
|
-
|
16
12
|
# For a Google Calendar, find the "iCal" link under your Calendar's settings
|
17
13
|
# c.add_ical_feed 'https://example.com/basic.ics'
|
18
14
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: almanack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Nicholls
|
@@ -347,6 +347,8 @@ files:
|
|
347
347
|
- checksums/almanack-1.1.3.gem.sha512
|
348
348
|
- checksums/almanack-1.1.3.rc1.gem.sha256
|
349
349
|
- checksums/almanack-1.1.3.rc1.gem.sha512
|
350
|
+
- checksums/almanack-1.1.5.gem.sha256
|
351
|
+
- checksums/almanack-1.1.5.gem.sha512
|
350
352
|
- example.ru
|
351
353
|
- exe/almanack
|
352
354
|
- lib/almanack.rb
|
@@ -357,7 +359,6 @@ files:
|
|
357
359
|
- lib/almanack/event.rb
|
358
360
|
- lib/almanack/event_source/ical.rb
|
359
361
|
- lib/almanack/event_source/ical_feed.rb
|
360
|
-
- lib/almanack/event_source/meetup_group.rb
|
361
362
|
- lib/almanack/event_source/static.rb
|
362
363
|
- lib/almanack/representation/built_ical_event.rb
|
363
364
|
- lib/almanack/representation/ical_feed.rb
|
@@ -402,5 +403,5 @@ requirements: []
|
|
402
403
|
rubygems_version: 3.0.3
|
403
404
|
signing_key:
|
404
405
|
specification_version: 4
|
405
|
-
summary: Combined events calendar for Google Calendar, iCal,
|
406
|
+
summary: Combined events calendar for Google Calendar, iCal, and friends.
|
406
407
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,129 +0,0 @@
|
|
1
|
-
module Almanack
|
2
|
-
module EventSource
|
3
|
-
class MeetupGroup
|
4
|
-
def initialize(options = {})
|
5
|
-
warn "Meetup have disabled support for API keys. Read more at https://github.com/Aupajo/almanack/issues/36"
|
6
|
-
@request_options = options
|
7
|
-
@group_properties = {}
|
8
|
-
end
|
9
|
-
|
10
|
-
def events_between(date_range)
|
11
|
-
events.select do |event|
|
12
|
-
event.start_time >= date_range.min && event.start_time <= date_range.max
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def serialized_between(date_range)
|
17
|
-
# TODO `events` must be called before @group_properties is accessed
|
18
|
-
serialized_events = events_between(date_range).map(&:serialized)
|
19
|
-
@group_properties.merge(events: serialized_events)
|
20
|
-
end
|
21
|
-
|
22
|
-
private
|
23
|
-
|
24
|
-
def events
|
25
|
-
results = MeetupAPIRequest.new(@request_options.clone).results
|
26
|
-
record_group_details_from results
|
27
|
-
results.map { |result| event_from(result) }
|
28
|
-
end
|
29
|
-
|
30
|
-
def record_group_details_from(results)
|
31
|
-
first_result = results.first
|
32
|
-
return if !first_result
|
33
|
-
|
34
|
-
group = first_result['group']
|
35
|
-
return if !group
|
36
|
-
|
37
|
-
@group_properties = {
|
38
|
-
name: group['name'],
|
39
|
-
url: "http://www.meetup.com/" + group['urlname']
|
40
|
-
}
|
41
|
-
end
|
42
|
-
|
43
|
-
def event_from(result)
|
44
|
-
# 3 hours, as recommended by Meetup.com if duration isn't present
|
45
|
-
default_duration_in_ms = 3 * 60 * 60 * 1000
|
46
|
-
|
47
|
-
event_name = [result['group']['name'], result['name']].compact.join(': ')
|
48
|
-
start_time = Time.at(result['time'] / 1000)
|
49
|
-
duration_in_secs = (result['duration'] || default_duration_in_ms) / 1000
|
50
|
-
end_time = start_time + duration_in_secs
|
51
|
-
|
52
|
-
Event.new(
|
53
|
-
title: event_name,
|
54
|
-
start_time: start_time,
|
55
|
-
end_time: end_time,
|
56
|
-
description: result['description'],
|
57
|
-
location: location_from_venue(result['venue']),
|
58
|
-
url: result['event_url']
|
59
|
-
)
|
60
|
-
end
|
61
|
-
|
62
|
-
def location_from_venue(venue)
|
63
|
-
return nil if venue.nil?
|
64
|
-
|
65
|
-
%w{ name address_1 address_2 address_3 city state country }.map do |attr|
|
66
|
-
venue[attr]
|
67
|
-
end.compact.join(', ')
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
class MeetupAPIError < StandardError
|
72
|
-
end
|
73
|
-
|
74
|
-
class MeetupAPIException < Exception
|
75
|
-
end
|
76
|
-
|
77
|
-
class MeetupAPIRequest
|
78
|
-
REQUIRED_OPTIONS = [:group_domain, :group_urlname, :group_id]
|
79
|
-
|
80
|
-
attr_reader :options, :connection
|
81
|
-
|
82
|
-
def initialize(options = {})
|
83
|
-
@connection = options.delete(:connection)
|
84
|
-
@options = options
|
85
|
-
end
|
86
|
-
|
87
|
-
def results
|
88
|
-
response['results']
|
89
|
-
end
|
90
|
-
|
91
|
-
def uri
|
92
|
-
if !options.has_key?(:key)
|
93
|
-
raise MeetupAPIException, 'Cannot form valid URI, missing :key option'
|
94
|
-
end
|
95
|
-
|
96
|
-
if (options.keys & REQUIRED_OPTIONS).empty?
|
97
|
-
raise MeetupAPIException, "Cannot form valid URI, missing one of: #{REQUIRED_OPTIONS}"
|
98
|
-
end
|
99
|
-
|
100
|
-
endpoint = "https://api.meetup.com/2/events"
|
101
|
-
|
102
|
-
Addressable::URI.parse(endpoint).tap do |uri|
|
103
|
-
uri.query_values = options
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
def response
|
108
|
-
response = connection.get(uri)
|
109
|
-
data = JSON.parse(response.body)
|
110
|
-
|
111
|
-
if data['problem']
|
112
|
-
raise MeetupAPIError, error_message_from(data)
|
113
|
-
end
|
114
|
-
|
115
|
-
data
|
116
|
-
end
|
117
|
-
|
118
|
-
def error_message_from(data)
|
119
|
-
message = [data['problem'], data['details']].compact.join(' - ')
|
120
|
-
|
121
|
-
if message.include?('not authorized')
|
122
|
-
message << ' ⚠️ See https://github.com/Aupajo/almanack/issues/36 for more details'
|
123
|
-
end
|
124
|
-
|
125
|
-
message
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|
129
|
-
end
|