Define events' date in YAML and continue displaying events 5 days after their start date (fixes #361)

This commit is contained in:
Saivann 2014-04-02 12:09:20 -04:00
parent 2cc99dbbed
commit 6e2960d1ba
24 changed files with 26 additions and 8 deletions

View file

@ -104,6 +104,7 @@ Events should be placed in `_events/YYYY-MM-DD-SHORTTITLE.md` and adhere to this
```
---
date: 2014-02-21
title: "2014 Texas Bitcoin Conference"
venue: "Circuit of the Americas™ - Technology and Conference Center"
address: "9201 Circuit of the Americas Blvd"

View file

@ -1,4 +1,5 @@
---
date: 2014-02-21
title: "Berlin, Texas: Bitcoin hackathon"
venue: "c-base Raumstation"
address: "Rungestraße 20, 10179"

View file

@ -1,4 +1,5 @@
---
date: 2014-03-05
title: "Bitcoin and Virtual Money"
venue: "NYSSA Conference Center"
address: "1540 Broadway"

View file

@ -1,4 +1,5 @@
---
date: 2014-03-06
title: "2014 Texas Bitcoin Conference"
venue: "Circuit of the Americas™ - Technology and Conference Center"
address: "9201 Circuit of the Americas Blvd"

View file

@ -1,4 +1,5 @@
---
date: 2014-03-18
title: "Bitcoinference 2014"
venue: "Amsterdam Science Park 123"
address: "1098 XG"

View file

@ -1,4 +1,5 @@
---
date: 2014-03-20
title: "Commercism Bitcoinference"
venue: "Microsoft Conference Center"
address: "1065 La Avenida Street, Building 1"

View file

@ -1,4 +1,5 @@
---
date: 2014-03-21
title: "Amsterdam MoneyLab: Coining Alternatives"
venue: "Lab 111"
address: "111 Arie Biemondstraat"

View file

@ -1,4 +1,5 @@
---
date: 2014-03-25
title: "CoinSummit"
venue: "Yerba Buena Center for the Arts"
address: "701 Mission Street"

View file

@ -1,4 +1,5 @@
---
date: 2014-03-27
title: "Bitcoin and Cryptocurrency Research Conference"
venue: "Friend Center Convocation Room, Princeton University"
address: "303 Sherrerd Hall"

View file

@ -1,4 +1,5 @@
---
date: 2014-04-03
title: "Swedish Bitcoin Conference 2014"
venue: "Finlandshuset Conference Center"
address: "Snickarbacken 4"

View file

@ -1,4 +1,5 @@
---
date: 2014-04-07
title: "Inside Bitcoins NYC"
venue: "Javits Convention Center"
address: "655 West 34th Street"

View file

@ -1,4 +1,5 @@
---
date: 2014-04-11
title: "Bitcoin Expo 2014"
venue: "Metro Toronto Convention Centre"
address: "255 Front St W"

View file

@ -1,4 +1,5 @@
---
date: 2014-04-23
title: "Bitcoin Conference Russia"
venue: "Business club Cabinet Lounge"
address: "No. 6 Novaya Ploshad, 109012"

View file

@ -1,4 +1,5 @@
---
date: 2014-05-10
title: "Global Bitcoin Summit 2014"
venue: "China National Convention Center"
address: "No.7 Tianchen East Road"

View file

@ -1,4 +1,5 @@
---
date: 2014-05-15
title: "Bitcoin Foundation Bitcoin 2014"
venue: "Passenger Terminal"
address: "Piet Heinkade 271019 BR"

View file

@ -1,4 +1,5 @@
---
date: 2014-05-31
title: "Central Europe Bitcoin Expo"
venue: "Austria Center Vienna"
address: "Bruno-Kreisky-Platz 1"

View file

@ -1,4 +1,5 @@
---
date: 2014-06-20
title: "Bitcoin in the Beltway"
venue: "Marriott Renaissance Downtown"
address: "999 9th St NW"

View file

@ -1,4 +1,5 @@
---
date: 2014-06-24
title: "Inside Bitcoins Conference & Expo"
venue: "Hong Kong SkyCity Marriott Hotel"
address: "1 Sky City Road East"

View file

@ -1,4 +1,5 @@
---
date: 2014-07-09
title: "Inside Bitcoins Conference & Expo"
venue: "Melbourne Convention and Exhibition Centre"
address: "South Wharf VIC 3006"

View file

@ -1,4 +1,5 @@
---
date: 2014-08-25
title: "Camp Bitcoin"
venue: "The Burning Man camp"
address: ""

View file

@ -1,4 +1,5 @@
---
date: 2014-09-01
title: "World Bitcoin Forum 2014"
venue: "The Bundeshaus"
address: "Platz der Vereinten Nationen 2"

View file

@ -1,4 +1,5 @@
---
date: 2014-09-15
title: "Inside Bitcoins London"
venue: "The Grange"
address: "10 Godliman St"

View file

@ -1,4 +1,5 @@
---
date: 2014-11-02
title: "Bitcoin World at Money2020"
venue: "Aria"
address: "3730 Las Vegas Blvd"

View file

@ -94,16 +94,11 @@ module Jekyll
Dir.foreach('_events') do |file|
# Skip events with malformed name
next if file == '.' or file == '..'
date = file.split('-')
next if date.length < 4
next if !/^[0-9]{4}$/.match(date[0])
next if !/^[0-9]{2}$/.match(date[1])
next if !/^[0-9]{2}$/.match(date[2])
# Skip event if not in the future
next if Time.new.to_i > Time.new(date[0].to_i,date[1].to_i,date[2].to_i).to_i
# Assign variables
data = YAML.load_file('_events/'+file)
data['date'] = date[0] + '-' + date[1] + '-' + date[2]
# Skip event if it has started more than five days ago
date = data['date'].to_s.split('-')
next if Time.new.to_i > (Time.new(date[0].to_i,date[1].to_i,date[2].to_i).to_i + 432000)
# Get geolocalisation data from Google Maps
begin
geoloc = JSON.parse(open("https://maps.googleapis.com/maps/api/geocode/json?address=" + CGI::escape(data['address'] + ', ' + data['city'] + ', ' + data['country']) + "&sensor=false","User-Agent"=>"Ruby/#{RUBY_VERSION}").read)