File tree 11 files changed +221
-200
lines changed
11 files changed +221
-200
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env rake
2
- require 'yaml'
3
- require 'date'
4
- require './data_file_validator'
5
- require './meetup_client'
2
+
3
+ require "yaml"
4
+ require "date"
5
+ require "ostruct"
6
+
7
+ require "./src/data_file_validator"
8
+ require "./src/static"
9
+ require "./src/meetup_client"
6
10
7
11
desc "Build Jekyll site"
8
12
task :build do
@@ -108,6 +112,10 @@ task :fetch_meetups do
108
112
puts "pull_request_title: #{ pull_request_title } "
109
113
File . write ( "./pull_request_title.txt" , pull_request_title )
110
114
115
+ Rake ::Task [ "sort_meetups" ] . invoke
116
+ end
117
+
118
+ task :sort_meetups do
111
119
events = YAML . load_file ( "./_data/meetups.yml" , permitted_classes : [ Date ] )
112
120
113
121
events . sort_by! { |event | [ event [ "date" ] , event [ "name" ] ] }
Original file line number Diff line number Diff line change 1429
1429
end_time : 20:00:00 EDT
1430
1430
url : https://lu.ma/af2n3jwa
1431
1431
1432
- - name : " Austin.rb - Visualizing Problems: From Abstract to Concrete"
1432
+ - name : ' Austin.rb - Visualizing Problems: From Abstract to Concrete'
1433
1433
location : Austin, TX
1434
1434
date : 2024-09-10
1435
1435
start_time : 18:30:00 CDT
Load Diff This file was deleted.
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ require "pathname"
2
+
3
+ require "graphql/client"
4
+ require "graphql/client/http"
5
+
6
+ module MeetupClient
7
+ BASE = "https://api.meetup.com/gql" . freeze
8
+ HTTP = GraphQL ::Client ::HTTP . new ( BASE ) do
9
+ def headers ( context )
10
+ {
11
+ Authorization : "Bearer #{ ENV [ "MEETUP_API_TOKEN" ] } " ,
12
+ "Content-Type" : "application/json" ,
13
+ }
14
+ end
15
+ end
16
+
17
+ Schema = GraphQL ::Client . load_schema ( "./src/meetup_graphql_schema.json" )
18
+ Client = GraphQL ::Client . new ( schema : Schema , execute : HTTP )
19
+ end
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ require_relative "../meetup_client"
2
+
3
+ EventsQuery = MeetupClient ::Client . parse ( <<-GRAPHQL
4
+ query ($groupId: String!) {
5
+ groupByUrlname(urlname: $groupId) {
6
+ id
7
+ logo {
8
+ id
9
+ baseUrl
10
+ preview
11
+ source
12
+ }
13
+ name
14
+ country
15
+ state
16
+ city
17
+ unifiedEvents(sortOrder: ASC) {
18
+ count
19
+ edges {
20
+ cursor
21
+ node {
22
+ id
23
+ title
24
+ eventUrl
25
+ shortDescription
26
+ description
27
+ onlineVenue {
28
+ type
29
+ url
30
+ }
31
+ venue {
32
+ address
33
+ city
34
+ state
35
+ country
36
+ }
37
+ host {
38
+ id
39
+ name
40
+ email
41
+ }
42
+ status
43
+ dateTime
44
+ endTime
45
+ duration
46
+ timezone
47
+ createdAt
48
+ eventType
49
+ isOnline
50
+ group {
51
+ id
52
+ name
53
+ country
54
+ state
55
+ city
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ GRAPHQL
63
+ )
Original file line number Diff line number Diff line change
1
+ module Static
2
+ end
3
+
4
+ require "frozen_record"
5
+
6
+ FrozenRecord ::Base . auto_reloading = true
7
+ FrozenRecord ::Base . base_path = "./_data"
8
+
9
+ require_relative "./static/conference"
10
+ require_relative "./static/meetup"
11
+ require_relative "./static/meetup_group"
Original file line number Diff line number Diff line change
1
+ require_relative "../static"
2
+
3
+ class Conference < FrozenRecord ::Base
4
+ end
Original file line number Diff line number Diff line change
1
+ require_relative "../static"
2
+
3
+ class Meetup < FrozenRecord ::Base
4
+ def service_id
5
+ if url . start_with? ( "https://www.meetup.com/" ) || url . start_with? ( "https://meetup.com/" )
6
+ url . split ( "/" ) . last
7
+ end
8
+ end
9
+ end
You can’t perform that action at this time.
0 commit comments