Script for generating Vortragsreihe event placeholders
This commit is contained in:
parent
c2f1975499
commit
5a8cb978dc
2 changed files with 77 additions and 14 deletions
|
|
@ -1,37 +1,62 @@
|
||||||
---
|
---
|
||||||
events:
|
events:
|
||||||
- title: CCCS Vortragsabend (Thema noch offen)
|
- title: CCCS Vortragsreihe (Thema noch offen)
|
||||||
startdate: 2015-01-08T19:30:00Z
|
startdate: 2015-01-08 19:30:00.000000000 +01:00
|
||||||
duration: 2h
|
duration: 2h
|
||||||
location:
|
location:
|
||||||
location: bib
|
location: bib
|
||||||
- title: CCCS Vortragsabend (Thema noch offen)
|
- title: CCCS Vortragsreihe (Thema noch offen)
|
||||||
startdate: 2015-02-12T19:30:00Z
|
startdate: 2015-02-12 19:30:00.000000000 +01:00
|
||||||
duration: 2h
|
duration: 2h
|
||||||
location:
|
location:
|
||||||
location: bib
|
location: bib
|
||||||
- title: CCCS Vortragsabend (Thema noch offen)
|
- title: CCCS Vortragsreihe (Thema noch offen)
|
||||||
startdate: 2015-02-12T19:30:00Z
|
startdate: 2015-03-12 19:30:00.000000000 +01:00
|
||||||
duration: 2h
|
duration: 2h
|
||||||
location:
|
location:
|
||||||
location: bib
|
location: bib
|
||||||
- title: CCCS Vortragsabend (Thema noch offen)
|
- title: CCCS Vortragsreihe (Thema noch offen)
|
||||||
startdate: 2015-03-12T19:30:00Z
|
startdate: 2015-04-09 19:30:00.000000000 +02:00
|
||||||
duration: 2h
|
duration: 2h
|
||||||
location:
|
location:
|
||||||
location: bib
|
location: bib
|
||||||
- title: CCCS Vortragsabend (Thema noch offen)
|
- title: CCCS Vortragsreihe (Thema noch offen)
|
||||||
startdate: 2015-04-09T19:30:00Z
|
startdate: 2015-05-14 19:30:00.000000000 +02:00
|
||||||
duration: 2h
|
duration: 2h
|
||||||
location:
|
location:
|
||||||
location: bib
|
location: bib
|
||||||
- title: CCCS Vortragsabend (Thema noch offen)
|
- title: CCCS Vortragsreihe (Thema noch offen)
|
||||||
startdate: 2015-05-14T19:30:00Z
|
startdate: 2015-06-11 19:30:00.000000000 +02:00
|
||||||
duration: 2h
|
duration: 2h
|
||||||
location:
|
location:
|
||||||
location: bib
|
location: bib
|
||||||
- title: CCCS Vortragsabend (Thema noch offen)
|
- title: CCCS Vortragsreihe (Thema noch offen)
|
||||||
startdate: 2015-06-11T19:30:00Z
|
startdate: 2015-07-09 19:30:00.000000000 +02:00
|
||||||
|
duration: 2h
|
||||||
|
location:
|
||||||
|
location: bib
|
||||||
|
- title: CCCS Vortragsreihe (Thema noch offen)
|
||||||
|
startdate: 2015-08-13 19:30:00.000000000 +02:00
|
||||||
|
duration: 2h
|
||||||
|
location:
|
||||||
|
location: bib
|
||||||
|
- title: CCCS Vortragsreihe (Thema noch offen)
|
||||||
|
startdate: 2015-09-10 19:30:00.000000000 +02:00
|
||||||
|
duration: 2h
|
||||||
|
location:
|
||||||
|
location: bib
|
||||||
|
- title: CCCS Vortragsreihe (Thema noch offen)
|
||||||
|
startdate: 2015-10-08 19:30:00.000000000 +02:00
|
||||||
|
duration: 2h
|
||||||
|
location:
|
||||||
|
location: bib
|
||||||
|
- title: CCCS Vortragsreihe (Thema noch offen)
|
||||||
|
startdate: 2015-11-12 19:30:00.000000000 +01:00
|
||||||
|
duration: 2h
|
||||||
|
location:
|
||||||
|
location: bib
|
||||||
|
- title: CCCS Vortragsreihe (Thema noch offen)
|
||||||
|
startdate: 2015-12-10 19:30:00.000000000 +01:00
|
||||||
duration: 2h
|
duration: 2h
|
||||||
location:
|
location:
|
||||||
location: bib
|
location: bib
|
||||||
|
|
|
||||||
38
scripts/generate-vortragsplatzhalter.rb
Executable file
38
scripts/generate-vortragsplatzhalter.rb
Executable file
|
|
@ -0,0 +1,38 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
|
# encoding: utf-8
|
||||||
|
|
||||||
|
require 'rubygems'
|
||||||
|
require 'bundler/setup'
|
||||||
|
|
||||||
|
require 'date'
|
||||||
|
require 'yaml'
|
||||||
|
|
||||||
|
|
||||||
|
def event(day, dayoffset, title)
|
||||||
|
startDate = Time.local(day.year, day.month, day.day + dayoffset, 19, 30, 0)
|
||||||
|
{
|
||||||
|
'title' => title,
|
||||||
|
'startdate' => startDate,
|
||||||
|
'duration' => '2h',
|
||||||
|
'location' => {
|
||||||
|
'location' => 'bib'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
year=ARGV[0].to_i
|
||||||
|
result = { 'events' => [] }
|
||||||
|
|
||||||
|
for month in 1..12
|
||||||
|
date = Date.new(year,month,1)
|
||||||
|
firstthursday = if (date.wday<=4)
|
||||||
|
date + (4-date.wday)
|
||||||
|
else
|
||||||
|
date + (11-date.wday)
|
||||||
|
end
|
||||||
|
result['events'] << event(firstthursday, 7, 'CCCS Vortragsreihe (Thema noch offen)')
|
||||||
|
end
|
||||||
|
|
||||||
|
puts result.to_yaml
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue