diff options
| -rw-r--r-- | db/authors.csv | 178 | ||||
| -rw-r--r-- | lib/tasks/development_init.rake | 24 | ||||
| -rw-r--r-- | lib/update_importer.rb | 5 |
3 files changed, 207 insertions, 0 deletions
diff --git a/db/authors.csv b/db/authors.csv new file mode 100644 index 0000000..9b679d2 --- /dev/null +++ b/db/authors.csv | |||
| @@ -0,0 +1,178 @@ | |||
| 1 | ,,,,,,,,,, | ||
| 2 | andy,Andy Müller-Maguhn,andy@ccc.de,,,,,,,, | ||
| 3 | arne,Arne Ludorff,arne@berlin.ccc.de,,,,,,,, | ||
| 4 | atoth,Andreas Lehner,atoth@ccc.de,,,,,,,, | ||
| 5 | ccc,Webmaster,webmaster@ccc.de,,,,,,,, | ||
| 6 | ccc-duesseldorf,Erfa-Kreis Düsseldorf,mail@chaosdorf.de,,,,,,,, | ||
| 7 | ccc-hamburg,Erfa-Kreis Hamburg,mail@hamburg.ccc.de,,,,,,,, | ||
| 8 | ccc-karlsruhe,Erfa-Kreis Karlsruhe,info@entropia.de,,,,,,,, | ||
| 9 | ccc-koeln,Erfa-Kreis Köln,oeffentliche-anfragen@koeln.ccc.de,,,,,,,, | ||
| 10 | c3bi,Erfa-Kreis Bielefeld,info@bielefeld.ccc.de,,,,,,,, | ||
| 11 | cryx,Philipp Wuensche,cryx@h3q.com,,,,,,,, | ||
| 12 | erdgeist,Dirk Engling,erdgeist@erdgeist.org,,,,,,,, | ||
| 13 | frankro,Frank Rosengart,frankro@berlin.ccc.de,,,,,,,, | ||
| 14 | fukami,Christian Horchert,fukami@c3d2.de,,,,,,,, | ||
| 15 | haegar,Sven Koch,haegar@ccc.de,,,,,,,, | ||
| 16 | jens,Jens Ohlig,jens@ccc.de,,,,,,,, | ||
| 17 | metaman,Benjamin Heitmann,benjamin@LauschAngriff.org,,,,,,,, | ||
| 18 | office,Office,office@ccc.de,,,,,,,, | ||
| 19 | padeluun,padeluun,padeluun@foebud.org,,,,,,,, | ||
| 20 | pylon,Lars Weiler,pylon@ccc.de,,,,,,,, | ||
| 21 | Pylon,Lars Weiler,pylon1@ccc.de,,,,,,,, | ||
| 22 | remission,Wau Remission,remission@ccc.de,,,,,,,, | ||
| 23 | stefan,Stefan Krecher,stefan@krecher.de,,,,,,,, | ||
| 24 | sz,Sebastian,sebastian@ccc.de,,,,,,,, | ||
| 25 | tim,Tim Pritlove,tim@ccc.de,,,,,,,, | ||
| 26 | tina,Tina Lorenz,tina@haecksen.org,,,,,,,, | ||
| 27 | webmaster,Webmaster,webmaster1@ccc.de,,,,,,,, | ||
| 28 | vorstand,Vorstand,vorstand@ccc.de,,,,,,,, | ||
| 29 | packet,packet,packet@berlin.ccc.de,,,,,,,, | ||
| 30 | Chaosradio,Chaosradio,chaosradio@ccc.de,,,,,,,, | ||
| 31 | presse,Presse,presse@ccc.de,,,,,,,, | ||
| 32 | congress,Congress-Crew,congress-crew@ccc.de,,,,,,,, | ||
| 33 | wetterfrosch,Matthias Mehldau,wetterminister@weltregierung.de,,,,,,,, | ||
| 34 | crazydj,Bastian Ballmann,crazydj@web.de,,,,,,,, | ||
| 35 | MiGri,MiGri,migri@ccc.de,,,,,,,, | ||
| 36 | iscs,Ingo Schwitters,iscs@ailis.de,,,,,,,, | ||
| 37 | kju,Michael Holzt,kju-web@fqdn.org,,,,,,,, | ||
| 38 | vt100,Peter Schwindt,peter@schwindt-net.de,,,,,,,, | ||
| 39 | volker_birk,Volker Birk,volker.birk@ulm.ccc.de,,,,,,,, | ||
| 40 | Fefe,Felix von Leitner,felix@fefe.de,,,,,,,, | ||
| 41 | goose,Sebastian Urbach,sebastian@ccc-hanau.de,,,,,,,, | ||
| 42 | photon,Alexander Taute,photon@vantronix.net,,,,,,,, | ||
| 43 | alexander,Alexander Bernauer,alexander.bernauer@ulm.ccc.de,,,,,,,, | ||
| 44 | maha,Martin Haase,mail@martinhaase.de,,,,,,,, | ||
| 45 | jm,Julius Mittenzwei,julius@muenchen-sued.de,,,,,,,, | ||
| 46 | mc.fly,Elmar Lecher,mc.fly@ramdrive.org,,,,,,,, | ||
| 47 | sinned,Dennis Wilson,sinned@chaostreff-dortmund.de,,,,,,,, | ||
| 48 | robert,Rob Vehrse,presse1@ccc.de,,,,,,,, | ||
| 49 | dennis,Dennis Schreiber,dennis@hamburg.ccc.de,,,,,,,, | ||
| 50 | desc,Dennis Schreiber,dennis1@hamburg.ccc.de,,,,,,,, | ||
| 51 | ,,,,,,,,,, | ||
| 52 | ,,,,,,,,,, | ||
| 53 | ,,,,,,,,,, | ||
| 54 | ,,,,,,,,,, | ||
| 55 | ,,,,,,,,,, | ||
| 56 | ,,,,,,,,,, | ||
| 57 | ,,,,,,,,,, | ||
| 58 | ,,,,,,,,,, | ||
| 59 | ,,,,,,,,,, | ||
| 60 | ,,,,,,,,,, | ||
| 61 | ,,,,,,,,,, | ||
| 62 | ,,,,,,,,,, | ||
| 63 | ,,,,,,,,,, | ||
| 64 | ,,,,,,,,,, | ||
| 65 | ,,,,,,,,,, | ||
| 66 | ,,,,,,,,,, | ||
| 67 | ,,,,,,,,,, | ||
| 68 | ,,,,,,,,,, | ||
| 69 | ,,,,,,,,,, | ||
| 70 | ,,,,,,,,,, | ||
| 71 | ,,,,,,,,,, | ||
| 72 | ,,,,,,,,,, | ||
| 73 | ,,,,,,,,,, | ||
| 74 | ,,,,,,,,,, | ||
| 75 | ,,,,,,,,,, | ||
| 76 | ,,,,,,,,,, | ||
| 77 | ,,,,,,,,,, | ||
| 78 | ,,,,,,,,,, | ||
| 79 | ,,,,,,,,,, | ||
| 80 | ,,,,,,,,,, | ||
| 81 | ,,,,,,,,,, | ||
| 82 | ,,,,,,,,,, | ||
| 83 | ,,,,,,,,,, | ||
| 84 | ,,,,,,,,,, | ||
| 85 | ,,,,,,,,,, | ||
| 86 | ,,,,,,,,,, | ||
| 87 | ,,,,,,,,,, | ||
| 88 | ,,,,,,,,,, | ||
| 89 | ,,,,,,,,,, | ||
| 90 | ,,,,,,,,,, | ||
| 91 | ,,,,,,,,,, | ||
| 92 | ,,,,,,,,,, | ||
| 93 | ,,,,,,,,,, | ||
| 94 | ,,,,,,,,,, | ||
| 95 | ,,,,,,,,,, | ||
| 96 | ,,,,,,,,,, | ||
| 97 | ,,,,,,,,,, | ||
| 98 | ,,,,,,,,,, | ||
| 99 | ,,,,,,,,,, | ||
| 100 | ,,,,,,,,,, | ||
| 101 | ,,,,,,,,,, | ||
| 102 | ,,,,,,,,,, | ||
| 103 | ,,,,,,,,,, | ||
| 104 | ,,,,,,,,,, | ||
| 105 | ,,,,,,,,,, | ||
| 106 | ,,,,,,,,,, | ||
| 107 | ,,,,,,,,,, | ||
| 108 | ,,,,,,,,,, | ||
| 109 | ,,,,,,,,,, | ||
| 110 | ,,,,,,,,,, | ||
| 111 | ,,,,,,,,,, | ||
| 112 | ,,,,,,,,,, | ||
| 113 | ,,,,,,,,,, | ||
| 114 | ,,,,,,,,,, | ||
| 115 | ,,,,,,,,,, | ||
| 116 | ,,,,,,,,,, | ||
| 117 | ,,,,,,,,,, | ||
| 118 | ,,,,,,,,,, | ||
| 119 | ,,,,,,,,,, | ||
| 120 | ,,,,,,,,,, | ||
| 121 | ,,,,,,,,,, | ||
| 122 | ,,,,,,,,,, | ||
| 123 | ,,,,,,,,,, | ||
| 124 | ,,,,,,,,,, | ||
| 125 | ,,,,,,,,,, | ||
| 126 | ,,,,,,,,,, | ||
| 127 | ,,,,,,,,,, | ||
| 128 | ,,,,,,,,,, | ||
| 129 | ,,,,,,,,,, | ||
| 130 | ,,,,,,,,,, | ||
| 131 | ,,,,,,,,,, | ||
| 132 | ,,,,,,,,,, | ||
| 133 | ,,,,,,,,,, | ||
| 134 | ,,,,,,,,,, | ||
| 135 | ,,,,,,,,,, | ||
| 136 | ,,,,,,,,,, | ||
| 137 | ,,,,,,,,,, | ||
| 138 | ,,,,,,,,,, | ||
| 139 | ,,,,,,,,,, | ||
| 140 | ,,,,,,,,,, | ||
| 141 | ,,,,,,,,,, | ||
| 142 | ,,,,,,,,,, | ||
| 143 | ,,,,,,,,,, | ||
| 144 | ,,,,,,,,,, | ||
| 145 | ,,,,,,,,,, | ||
| 146 | ,,,,,,,,,, | ||
| 147 | ,,,,,,,,,, | ||
| 148 | ,,,,,,,,,, | ||
| 149 | ,,,,,,,,,, | ||
| 150 | ,,,,,,,,,, | ||
| 151 | ,,,,,,,,,, | ||
| 152 | ,,,,,,,,,, | ||
| 153 | ,,,,,,,,,, | ||
| 154 | ,,,,,,,,,, | ||
| 155 | ,,,,,,,,,, | ||
| 156 | ,,,,,,,,,, | ||
| 157 | ,,,,,,,,,, | ||
| 158 | ,,,,,,,,,, | ||
| 159 | ,,,,,,,,,, | ||
| 160 | ,,,,,,,,,, | ||
| 161 | ,,,,,,,,,, | ||
| 162 | ,,,,,,,,,, | ||
| 163 | ,,,,,,,,,, | ||
| 164 | ,,,,,,,,,, | ||
| 165 | ,,,,,,,,,, | ||
| 166 | ,,,,,,,,,, | ||
| 167 | ,,,,,,,,,, | ||
| 168 | ,,,,,,,,,, | ||
| 169 | ,,,,,,,,,, | ||
| 170 | ,,,,,,,,,, | ||
| 171 | ,,,,,,,,,, | ||
| 172 | ,,,,,,,,,, | ||
| 173 | ,,,,,,,,,, | ||
| 174 | ,,,,,,,,,, | ||
| 175 | ,,,,,,,,,, | ||
| 176 | ,,,,,,,,,, | ||
| 177 | ,,,,,,,,,, | ||
| 178 | ,,,,,,,,,, \ No newline at end of file | ||
diff --git a/lib/tasks/development_init.rake b/lib/tasks/development_init.rake index 7c732d2..886474b 100644 --- a/lib/tasks/development_init.rake +++ b/lib/tasks/development_init.rake | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | require 'csv' | ||
| 2 | |||
| 1 | namespace :cccms do | 3 | namespace :cccms do |
| 2 | 4 | ||
| 3 | desc "Create admin:foobar user:password" | 5 | desc "Create admin:foobar user:password" |
| @@ -10,6 +12,28 @@ namespace :cccms do | |||
| 10 | ) | 12 | ) |
| 11 | end | 13 | end |
| 12 | 14 | ||
| 15 | desc "Import the authors" | ||
| 16 | task :import_authors => :environment do |t| | ||
| 17 | I18n.locale = :en | ||
| 18 | @parsed_file = CSV::Reader.parse(File.open("#{RAILS_ROOT}/db/authors.csv")) | ||
| 19 | |||
| 20 | @parsed_file.each_with_index do |row, index| | ||
| 21 | next if row[0].nil? | ||
| 22 | |||
| 23 | unless author = User.find_by_login(row[0]) | ||
| 24 | puts "#{row[0]} >> #{row[2]}" | ||
| 25 | author = User.create!( | ||
| 26 | :login => row[0], | ||
| 27 | #:realname => row[1], | ||
| 28 | :email => row[2], | ||
| 29 | :password => "foobartrallala", | ||
| 30 | :password_confirmation => "foobartrallala" | ||
| 31 | ) | ||
| 32 | end | ||
| 33 | |||
| 34 | end | ||
| 35 | end | ||
| 36 | |||
| 13 | desc "Import the old XML Files" | 37 | desc "Import the old XML Files" |
| 14 | task :import_updates => :environment do |t| | 38 | task :import_updates => :environment do |t| |
| 15 | i = UpdateImporter.new("#{RAILS_ROOT}/db/updates") | 39 | i = UpdateImporter.new("#{RAILS_ROOT}/db/updates") |
diff --git a/lib/update_importer.rb b/lib/update_importer.rb index 1fcf40e..49614b4 100644 --- a/lib/update_importer.rb +++ b/lib/update_importer.rb | |||
| @@ -99,6 +99,11 @@ class UpdateImporter | |||
| 99 | 99 | ||
| 100 | end | 100 | end |
| 101 | 101 | ||
| 102 | if xhtml.elements['author'] | ||
| 103 | user = User.find_by_login(xhtml.elements['author'].get_text.to_s) | ||
| 104 | page.user = user | ||
| 105 | end | ||
| 106 | |||
| 102 | page.published_at = date.to_time | 107 | page.published_at = date.to_time |
| 103 | page.save! | 108 | page.save! |
| 104 | 109 | ||
