From f80aa4be3aa7a88915296c7413fca95e0647274b Mon Sep 17 00:00:00 2001 From: Saivann Date: Thu, 29 Jan 2015 11:51:10 -0500 Subject: [PATCH] Add Coinfest as an international event --- _events.yml | 10 ++++------ _plugins/events.rb | 14 ++++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/_events.yml b/_events.yml index a9d5d35b..9ae83d7f 100644 --- a/_events.yml +++ b/_events.yml @@ -23,12 +23,10 @@ link: "https://www.ecurex.com/p2pfisy/" - date: 2015-02-20 - title: "#CoinFestRussia. The first decentralized currency convention & International festival" - venue: "ETAZHI loft area, 'Zona Space' coworking center & educational club" - address: "Ligovsky Prospect, 74" - city: "Saint-Petersburg" - country: "Russia" - link: "http://coinfestrussia.com" + title: "Coinfest. The first decentralized decentralized currency convention" + city: "Many cities" + country: "Worldwide" + link: "http://www.coinfest.org/" - date: 2015-02-26 title: "Chambe-Carnet: Bitcoin, initiation à l’argent P2P et opportunités" diff --git a/_plugins/events.rb b/_plugins/events.rb index 4ced06f4..2f2ebb88 100644 --- a/_plugins/events.rb +++ b/_plugins/events.rb @@ -101,13 +101,15 @@ module Jekyll 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) - if geoloc['status'] == 'OK' - data['geoloc'] = geoloc['results'][0]['geometry']['location']['lat'].to_s + ", " + geoloc['results'][0]['geometry']['location']['lng'].to_s + if data.has_key?('address') + 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) + if geoloc['status'] == 'OK' + data['geoloc'] = geoloc['results'][0]['geometry']['location']['lat'].to_s + ", " + geoloc['results'][0]['geometry']['location']['lng'].to_s + end + rescue + print 'Google Maps API Call Failed!' end - rescue - print 'Google Maps API Call Failed!' end # Populate conferences array conferences.push(data)