forked from JiggyPete/global-diversity-cfp-day-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_speaker_card_urls.rb
37 lines (32 loc) · 1008 Bytes
/
generate_speaker_card_urls.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'yaml'
require 'erb'
def build_url(continent, speaker)
# puts continent
# puts speaker
profile_picture = speaker["profile_picture"]
if profile_picture.start_with?("/images")
profile_picture = "https://www.globaldiversitycfpday.com" + profile_picture
end
twitter = "#{speaker["pronouns"]} @#{speaker["twitter"]}".strip
base_url = "https://jiggypete.github.io/speaker-promo"
# base_url = "http://localhost:5000"
url = "#{base_url}/?name=#{speaker["name"]}&twitter=#{twitter}&talk=#{speaker["talk_title"]}&continent=#{continent}&picture-url=#{profile_picture}"
puts `open "#{url}"`
end
yml = YAML.load(File.read("config/continents.yml"))
continent_data = [
yml["australia_and_oceania"]
# yml["asia"]
# yml["africa"]
# yml["europe"]
# yml["north_america"]
# yml["south_america"]
]
continent_data.each do |continent|
puts ""
puts ""
continent_name = continent["name"]
continent["speakers"].each do |speaker|
build_url continent_name, speaker
end
end