Skip to content

Commit fed2616

Browse files
authored
Automate fetching Meetups from Meetup.com (ruby-conferences#720)
* Automate fetching Meetups from Meetup.com * Cleanup Meetup data Use numeric meetup ids where possible * Improve location generation
1 parent b5e0e49 commit fed2616

8 files changed

Lines changed: 922 additions & 20 deletions

File tree

.github/workflows/meetups.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Fetch Meetups
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 0 * * *" # Runs every day at 00:00 UTC time
7+
8+
permissions:
9+
pull-requests: write
10+
contents: write
11+
12+
jobs:
13+
fetch:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Ruby
18+
19+
uses: ruby/setup-ruby@v1
20+
with:
21+
bundler-cache: true
22+
23+
- name: Check for new Meetups
24+
run: bundle exec rake fetch_meetups
25+
26+
- name: Verify Meetups Data
27+
run: bundle exec rake verify_meetups
28+
29+
- name: Set up the formatted date and branch name
30+
run: |
31+
echo "FORMATTED_DATE=$(date +'%B %d, %Y')" >> $GITHUB_ENV
32+
echo "BRANCH_TO_MERGE=new-meetups-$(date +'%Y-%m-%d')" >> $GITHUB_ENV
33+
34+
- name: Commit New Meetups
35+
uses: stefanzweifel/git-auto-commit-action@v5
36+
with:
37+
# Optional. Commit message for the created commit.
38+
# Defaults to "Apply automatic changes"
39+
commit_message: New Meetups on ${{ env.FORMATTED_DATE }}
40+
41+
# Optional. Local and remote branch name where commit is going to be pushed
42+
# to. Defaults to the current branch.
43+
# You might need to set `create_branch: true` if the branch does not exist.
44+
branch: ${{ env.BRANCH_TO_MERGE }}
45+
46+
# Optional. Options used by `git-commit`.
47+
# See https://git-scm.com/docs/git-commit#_options
48+
# commit_options: '--no-verify --signoff'
49+
50+
# Optional glob pattern of files which should be added to the commit
51+
# Defaults to all (.)
52+
# See the `pathspec`-documentation for git
53+
# - https://git-scm.com/docs/git-add#Documentation/git-add.txt-ltpathspecgt82308203
54+
# - https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec
55+
file_pattern: '_data/*.yml'
56+
57+
# Optional. Local file path to the repository.
58+
# Defaults to the root of the repository.
59+
# repository: .
60+
61+
# Optional commit user and author settings
62+
# commit_user_name: My GitHub Actions Bot # defaults to "github-actions[bot]"
63+
# commit_user_email: my-github-actions-bot@example.org # defaults to "41898282+github-actions[bot]@users.noreply.github.com"
64+
# commit_author: Author <actions@github.com> # defaults to "username <username@users.noreply.github.com>", where "username" belongs to the author of the commit that triggered the run
65+
66+
# Optional. Tag name being created in the local repository and
67+
# pushed to remote repository and defined branch.
68+
# tagging_message: 'v1.0.0'
69+
70+
# Optional. Option used by `git-status` to determine if the repository is
71+
# dirty. See https://git-scm.com/docs/git-status#_options
72+
status_options: '--untracked-files=no'
73+
74+
# Optional. Options used by `git-add`.
75+
# See https://git-scm.com/docs/git-add#_options
76+
# add_options: '-u'
77+
78+
# Optional. Options used by `git-push`.
79+
# See https://git-scm.com/docs/git-push#_options
80+
# push_options: '--force'
81+
82+
# Optional. Disable dirty check and always try to create a commit and push
83+
# skip_dirty_check: true
84+
85+
# Optional. Skip internal call to `git fetch`
86+
# skip_fetch: true
87+
88+
# Optional. Skip internal call to `git checkout`
89+
# skip_checkout: true
90+
91+
# Optional. Prevents the shell from expanding filenames.
92+
# Details: https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html
93+
# disable_globbing: true
94+
95+
# Optional. Create given branch name in local and remote repository.
96+
create_branch: true
97+
98+
- name: Create Pull Request
99+
run: gh pr create -B main -H ${{ env.BRANCH_TO_MERGE }} --title "New Meetups on ${{ env.FORMATTED_DATE }}" --body "Newly added Meetups on ${{ env.FORMATTED_DATE }}."

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ gem 'danger-commit_lint'
88
gem 'html-proofer'
99
gem 'jekyll'
1010
gem 'rake'
11+
gem 'graphql-client', '~> 0.23.0'
12+
gem 'frozen_record', '~> 0.27.2'
13+
gem 'countries', '~> 6.0'
1114

1215
group :jekyll_plugins do
1316
gem 'jekyll-feed'

Gemfile.lock

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,27 @@ GEM
22
remote: https://rubygems.org/
33
specs:
44
Ascii85 (1.1.0)
5+
activemodel (7.2.1)
6+
activesupport (= 7.2.1)
7+
activesupport (7.2.1)
8+
base64
9+
bigdecimal
10+
concurrent-ruby (~> 1.0, >= 1.3.1)
11+
connection_pool (>= 2.2.5)
12+
drb
13+
i18n (>= 1.6, < 2)
14+
logger (>= 1.4.2)
15+
minitest (>= 5.1)
16+
securerandom (>= 0.3)
17+
tzinfo (~> 2.0, >= 2.0.5)
518
addressable (2.8.6)
619
public_suffix (>= 2.0.2, < 6.0)
720
afm (0.2.2)
821
async (2.3.1)
922
console (~> 1.10)
1023
io-event (~> 1.1)
1124
timers (~> 4.1)
25+
base64 (0.2.0)
1226
bigdecimal (3.1.8)
1327
claide (1.1.0)
1428
claide-plugins (0.9.2)
@@ -18,10 +32,13 @@ GEM
1832
colorator (1.1.0)
1933
colored2 (3.1.2)
2034
concurrent-ruby (1.3.3)
35+
connection_pool (2.4.1)
2136
console (1.16.2)
2237
fiber-local
2338
cork (0.3.0)
2439
colored2 (~> 3.1)
40+
countries (6.0.1)
41+
unaccent (~> 0.3)
2542
danger (9.2.0)
2643
claide (~> 1.0)
2744
claide-plugins (>= 0.9.2)
@@ -39,6 +56,7 @@ GEM
3956
danger-plugin-api (~> 1.0)
4057
danger-plugin-api (1.0.0)
4158
danger (> 2.0)
59+
drb (2.2.1)
4260
em-websocket (0.5.3)
4361
eventmachine (>= 0.12.9)
4462
http_parser.rb (~> 0)
@@ -53,13 +71,22 @@ GEM
5371
faraday-net_http (3.0.2)
5472
ffi (1.17.0)
5573
fiber-local (1.0.0)
74+
fiber-storage (1.0.0)
5675
forwardable-extended (2.6.0)
76+
frozen_record (0.27.2)
77+
activemodel
5778
git (1.13.2)
5879
addressable (~> 2.8)
5980
rchardet (~> 1.8)
6081
google-protobuf (4.27.1)
6182
bigdecimal
6283
rake (>= 13)
84+
graphql (2.3.14)
85+
base64
86+
fiber-storage
87+
graphql-client (0.23.0)
88+
activesupport (>= 3.0)
89+
graphql (>= 1.13.0)
6390
hashery (2.1.2)
6491
html-proofer (5.0.4)
6592
addressable (~> 2.3)
@@ -104,8 +131,10 @@ GEM
104131
listen (3.9.0)
105132
rb-fsevent (~> 0.10, >= 0.10.3)
106133
rb-inotify (~> 0.9, >= 0.9.10)
134+
logger (1.6.0)
107135
mercenary (0.4.0)
108136
mini_portile2 (2.8.6)
137+
minitest (5.25.1)
109138
nap (1.1.0)
110139
no_proxy_fix (0.1.2)
111140
nokogiri (1.16.5)
@@ -143,13 +172,17 @@ GEM
143172
sawyer (0.9.2)
144173
addressable (>= 2.3.5)
145174
faraday (>= 0.17.3, < 3)
175+
securerandom (0.3.1)
146176
strscan (3.1.0)
147177
terminal-table (3.0.2)
148178
unicode-display_width (>= 1.1.1, < 3)
149179
timers (4.3.5)
150180
ttfunk (1.7.0)
151181
typhoeus (1.4.0)
152182
ethon (>= 0.9.0)
183+
tzinfo (2.0.6)
184+
concurrent-ruby (~> 1.0)
185+
unaccent (0.4.0)
153186
unicode-display_width (2.5.0)
154187
webrick (1.8.1)
155188
yell (2.2.2)
@@ -159,8 +192,11 @@ PLATFORMS
159192
ruby
160193

161194
DEPENDENCIES
195+
countries (~> 6.0)
162196
danger
163197
danger-commit_lint
198+
frozen_record (~> 0.27.2)
199+
graphql-client (~> 0.23.0)
164200
html-proofer
165201
jekyll
166202
jekyll-feed

Rakefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
require 'yaml'
33
require 'date'
44
require './data_file_validator'
5+
require './meetup_client'
56

67
desc "Build Jekyll site"
78
task :build do
@@ -67,4 +68,16 @@ task :verify_meetups do
6768
exit 5 unless dates.sort == dates
6869
end
6970

71+
task :fetch_meetups do
72+
MeetupGroup.all.each do |group|
73+
group.write_new_meetups!
74+
end
75+
76+
events = YAML.load_file("./_data/meetups.yml", permitted_classes: [Date])
77+
78+
events.sort_by! { |event| [event["date"], event["name"]] }
79+
80+
File.write("./_data/meetups.yml", events.to_yaml.gsub("- name:", "\n- name:"))
81+
end
82+
7083
task default: [:build, :verify_data, :verify_html]

_data/meetup_groups.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
- id: austinrb
2+
name: AustinRB
3+
service: meetupdotcom
4+
5+
- id: barcelona-rb
6+
name: Barcelona.rb
7+
service: meetupdotcom
8+
9+
# - id: bostonrb
10+
# name: Boston Ruby Group
11+
# service: meetupdotcom
12+
13+
- id: bostonrb
14+
name: Boston Ruby Group
15+
service: luma
16+
ical_url: https://api.lu.ma/ics/get?entity=calendar&id=cal-O0xLKEqq4Q8vc8f
17+
18+
- id: boulder-ruby
19+
name: Boulder Ruby
20+
service: luma
21+
ical_url: https://api.lu.ma/ics/get?entity=calendar&id=cal-B9LZxdgJiXBxezw
22+
23+
- id: brooklyn-rb
24+
name: brooklyn.rb
25+
service: meetupdotcom
26+
27+
- id: charlotte-rb
28+
name: Charlotte Ruby Meetup Group
29+
service: meetupdotcom
30+
31+
- id: chicagoruby
32+
name: ChicagoRuby
33+
service: meetupdotcom
34+
35+
- id: copenhagen-ruby-brigade
36+
name: Copenhagen Ruby Brigade
37+
service: meetupdotcom
38+
39+
- id: frankfurt-ruby-meetup
40+
name: Frankfurt Ruby Meetup
41+
service: meetupdotcom
42+
43+
- id: geneva-rb
44+
name: Geneva.rb
45+
service: meetupdotcom
46+
47+
- id: houstonruby
48+
name: Houston Ruby
49+
service: meetupdotcom
50+
51+
- id: krakow-ruby-users-group
52+
name: Krakow Ruby Users Group (KRUG)
53+
service: meetupdotcom
54+
55+
- id: laruby
56+
name: LA Ruby - The Los Angeles Ruby Meetup Group
57+
service: meetupdotcom
58+
59+
- id: lyonrb
60+
name: Lyon.rb
61+
service: meetupdotcom
62+
63+
- id: nyc-rb
64+
name: NYC.rb
65+
service: meetupdotcom
66+
67+
- id: paris_rb
68+
name: ParisRB.new
69+
service: meetupdotcom
70+
71+
- id: phillyrb
72+
name: Philly.rb
73+
service: meetupdotcom
74+
75+
- id: polishrubyusergroup
76+
name: Polish Ruby User Group
77+
service: meetupdotcom
78+
79+
- id: ruby-az
80+
name: Ruby::AZ
81+
service: meetupdotcom
82+
83+
- id: ruby-in-london
84+
name: Ruby in London
85+
service: meetupdotcom
86+
87+
- id: ruby-montevideo
88+
name: Ruby Montevideo
89+
service: meetupdotcom
90+
91+
- id: ruby-phil
92+
name: Philippine Ruby Users Group
93+
service: meetupdotcom
94+
95+
- id: ruby-romania
96+
name: Ruby Romania
97+
service: meetupdotcom
98+
99+
- id: rubyba
100+
name: Ruby Buenos Aires
101+
service: meetupdotcom
102+
103+
- id: rubyonrails-ch
104+
name: Ruby on Rails Schweiz
105+
service: meetupdotcom
106+
107+
# - id: TODO
108+
# name: SF
109+
# service: luma
110+
111+
- id: sdruby
112+
name: SD Ruby
113+
service: meetupdotcom
114+
115+
- id: the-bluegrass-developers-guild
116+
name: Bluegrass Ruby Users Group
117+
filter: Bluegrass Ruby
118+
service: meetupdotcom
119+
120+
- id: upstate-ruby
121+
name: Upstate Ruby
122+
service: meetupdotcom

0 commit comments

Comments
 (0)