From dd183627df459351cc94611d3a66c1312b47a3bc Mon Sep 17 00:00:00 2001 From: Aaron Fischer Date: Mon, 2 Nov 2020 10:30:12 +0100 Subject: [PATCH] Make source configurable (support comics and more!) This fixes #5 #6 and #7 --- .gitignore | 5 +- Dockerfile | 4 +- INSTALL.mkd | 4 +- README.mkd | 159 ++---------------- project.clj | 4 +- public/{styles.css => book.css} | 4 +- .../layout_book => public/book.html | 13 +- public/comic.css | 44 +++++ public/comic.html | 28 +++ src/buchdesmonats/{layout.html => book.html} | 2 +- .../{layout_comic => comic.html} | 2 +- src/buchdesmonats/core.clj | 28 +-- 12 files changed, 118 insertions(+), 179 deletions(-) rename public/{styles.css => book.css} (89%) rename src/buchdesmonats/layout_book => public/book.html (82%) create mode 100644 public/comic.css create mode 100644 public/comic.html rename src/buchdesmonats/{layout.html => book.html} (96%) rename src/buchdesmonats/{layout_comic => comic.html} (95%) diff --git a/.gitignore b/.gitignore index c2b60a9..1a5a84a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,8 @@ pom.xml.asc /.lein-* /.nrepl-port /.project -/public/index.html + +/public/book.html +/public/comic.html +/public/comic-covers/ /public/book-covers/ diff --git a/Dockerfile b/Dockerfile index afd80d7..f66e265 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM java:8 -ADD buchdesmonats-1.5.jar /buchdesmonats/ +ADD buchdesmonats-1.7.jar /buchdesmonats/ WORKDIR /buchdesmonats -CMD ["java", "-jar", "buchdesmonats-1.5.jar"] +CMD ["java", "-jar", "buchdesmonats-1.7.jar"] diff --git a/INSTALL.mkd b/INSTALL.mkd index f1e6e24..df449a2 100644 --- a/INSTALL.mkd +++ b/INSTALL.mkd @@ -6,9 +6,9 @@ looking visual representation of the book covers. # Building lein uberjar - java -jar target/buchdesmonats-1.5-standalone.jar + java -jar target/buchdesmonats-1.7-standalone.jar - cp target/buchdesmonats-1.5-standalone.jar buchdesmonats-1.5.jar + cp target/buchdesmonats-1.7-standalone.jar buchdesmonats-1.7.jar docker build -t buchdesmonats . # Running diff --git a/README.mkd b/README.mkd index e967d3e..3fc6eaf 100644 --- a/README.mkd +++ b/README.mkd @@ -1,154 +1,17 @@ -## 2020 -* Januar [Yevgeny Zamyatin "We: Introduction by Will Self"](https://www.lovelybooks.de/autor/Yevgeny-Zamyatin/We-Introduction-by-Will-Self-English-Edition-2149622119-w/) -* Februar [Sibylle Berg "GRM"](https://www.lovelybooks.de/autor/Sibylle-Berg/GRM-1812098600-w/) -* März [James Corey "Leviathan erwacht"](https://www.lovelybooks.de/autor/James-Corey/Leviathan-erwacht-939751475-w/) -* April [Douglas Preston "Dark Zero"](https://www.lovelybooks.de/autor/Douglas-Preston/Dark-Zero-1128275472-w/) -* Mai [Alastair Reynolds "Okular"](https://www.lovelybooks.de/autor/Alastair-Reynolds/Okular-1208142296-w/) -* Juni [William-Hertling "AVOGADRO CORP."](https://www.lovelybooks.de/autor/William-Hertling/Avogadro-Corp-Roman-Singularity-1--1288253015-w/) -* Juli [Janina Loh "Roboterethik - Eine Einführung"](https://www.lovelybooks.de/autor/Janina-Loh/Roboterethik-Eine-Einf%C3%BChrung-suhrkamp-taschenbuch-wissenschaft-2425159983-w/) -* August [Craig Smith "The Car Hackers Handbook"](https://www.lovelybooks.de/autor/Craig-Smith/The-Car-Hacker-s-Handbook-A-Guide-for-the-Penetration-Tester-2432126055-w/) -* September [Isaac Asimov "Ich der Roboter"](https://www.lovelybooks.de/autor/Isaac-Asimov/Ich-der-Roboter-143034100-w/) -* Oktober [Fabian Navarro "poesie.exe"](https://www.lovelybooks.de/autor/Fabian-Navarro/poesie-exe-2581938157-w/) -* November [Tom Hillenbrand "Qube"](https://www.lovelybooks.de/autor/Tom-Hillenbrand/Qube-2330289475-w/) +# Buch des Monats -## 2019 -* Januar: [Christopher Ruocchio "Das Imperium der Stille"](https://www.lovelybooks.de/autor/Christopher-Ruocchio/Das-Imperium-der-Stille-1551303829-w/) -* Februar: [Daniel Suarez "Bios"](https://www.lovelybooks.de/autor/Daniel-Suarez/Bios-1655787316-w/) -* März: [Terry Pratchett "Aus der Tastatur gefallen"](https://www.lovelybooks.de/autor/Terry-Pratchett/Aus-der-Tastatur-gefallen-1506150824-w/) -* April: [Daniel Martin Feige "Computerspiele: Eine Ästhetik"](https://www.lovelybooks.de/autor/Daniel-Martin-Feige/Computerspiele-Eine-%C3%84sthetik-suhrkamp-taschenbuch-wissenschaft-Band-2160-1748907522-w/) -* Mai: [Andreas Eschbach "NSA - Nationales Sicherheits-Amt"](https://www.lovelybooks.de/autor/Andreas-Eschbach/NSA-Nationales-Sicherheits-Amt-1569360209-w/) -* Juni: [Ian McEwan "Maschinen wie ich"](https://www.lovelybooks.de/autor/Ian-McEwan/Maschinen-wie-ich-1803183551-w/) -* Juli: [Berit Glanz "Pixeltänzer"](https://www.lovelybooks.de/autor/Berit-Glanz/Pixelt%C3%A4nzer-2031512384-w/) -* August: [Dietmar Dath "Venus siegt"](https://www.lovelybooks.de/autor/Dietmar-Dath/Venus-siegt-1238026112-w/) -* September: [Andreas Eschbach "Das größte Abenteuer"](https://www.lovelybooks.de/autor/Andreas-Eschbach/Perry-Rhodan-Das-gr%C3%B6%C3%9Fte-Abenteuer-1955713268-w/) -* Oktober: [Christiane-Frohmann "Präraffaelitische Girls erklären das Internet"](https://www.lovelybooks.de/autor/Christiane-Frohmann/Pr%C3%A4raffaelitische-Girls-erkl%C3%A4ren-das-Internet-1499687993-w/) -* November: [Helen Stelthove "Pretty Fly For A Wifi"](https://www.lovelybooks.de/autor/Helen-Stelthove/Pretty-Fly-For-A-Wifi-2032951731-w/) -* Dezember: [Antonio Garcia Martinez "Chaos Monkeys"](https://www.lovelybooks.de/autor/Antonio-Garcia-Martinez/Chaos-Monkeys-1565378792-w/) +This simple script generate a HTML representation of the "Book of the Month" +list. This includes books and comics. -## 2018 +## Building -* Januar: [Ray Bradbury "Fahrenheit 451"](https://www.lovelybooks.de/autor/Ray-Bradbury/Fahrenheit-451-142592140-w/) -* Februar: [Richard Morgan "Altered Carbon"](https://www.lovelybooks.de/autor/Richard-Morgan/Altered-Carbon-Das-Unsterblichkeitsprogramm-143374520-w/) -* März: [Marc-Uwe Kling "QualityLand"](https://www.lovelybooks.de/autor/Marc--Uwe-Kling-/QualityLand-1455496828-w/) -* April: [Malka Older "Infomocracy"](https://www.lovelybooks.de/autor/Malka-Older/Infomocracy-A-Novel-The-Centenal-Cycle-1467887165-w/) -* Mai: [Marge Piercy "Er, Sie und Es"](https://www.lovelybooks.de/autor/Marge-Piercy/Er-Sie-und-Es-143796880-w/) -* Juni: [Josefine Rieks "Serverland"](https://www.lovelybooks.de/autor/Josefine-Rieks/Serverland-1499366030-w/) -* Juli: [Eliot Peper "Bandwith - an Analog Novel"](https://www.lovelybooks.de/autor/Eliot-Peper/Bandwidth-An-Analog-Novel-1571402726-w/) -* August: [Becky Chambers "Der lange Weg zu einem kleinen zornigen Planeten"](https://www.lovelybooks.de/autor/Becky-Chambers/Der-lange-Weg-zu-einem-kleinen-zornigen-Planeten-1238032294-w/) -* September: [Dennis E. Taylor "Ich bin viele"](https://www.lovelybooks.de/autor/Dennis-E.-Taylor/Ich-bin-viele-1506148622-w/) -* Oktober: [Christian Humberg "Geek, Pray, Love"](https://www.lovelybooks.de/autor/Christian-Humberg/Geek-Pray-Love-1100319918-w/) -* November: [Katharina Nocun "Die Daten, die ich rief"](https://www.lovelybooks.de/autor/Katharina-Nocun/Die-Daten-die-ich-rief-1503715944-w/) -* Dezember: [Holger Volland "Die kreative Macht der Maschinen"](https://www.lovelybooks.de/autor/Holger-Volland/Die-kreative-Macht-der-Maschinen-1504890518-w/) + $ lein uberjar -## 2017 +## Usage -* Januar: [Pola Oloixarac "Kryptozän"](https://www.lovelybooks.de/autor/Pola-Oloixarac/Kryptoz%C3%A4n-1238987491-w/) -* Februar: [William Gibson "Peripherie"](https://www.lovelybooks.de/autor/William-Gibson/Peripherie-1286083501-w/) -* März: [Max Brooks "Minecraft - The Island"](https://www.lovelybooks.de/autor/Max-Brooks/Minecraft-The-Island-A-Novel-1473578772-w/) -* April: [Clemens J. Setz "Bot"](https://www.lovelybooks.de/autor/Clemens-J.-Setz/Bot-1499342622-w/) -* Mai: [Ernest Cline "Armada"](https://www.lovelybooks.de/autor/Ernest-Cline/Armada-1355925192-w/) -* Juni: [Jeff Potter "Kochen für Geeks"](https://www.lovelybooks.de/autor/Jeff-Potter/Kochen-f%C3%BCr-Geeks-1244395879-w/) -* Juli: [Doron Rabinovici "Die Aussererirdischen"](https://www.lovelybooks.de/autor/Doron-Rabinovici/Die-Au%C3%9Ferirdischen-1448961998-w/) -* August: [Margaret Atwood "Das Herz kommt zuletzt"](https://www.lovelybooks.de/autor/Margaret-Atwood/Das-Herz-kommt-zuletzt-1358249641-w/) -* September: [Jingfang Hao "Peking falten"](https://www.lovelybooks.de/autor/Jingfang-Hao/Peking-falten-1430138472-w/) -* Oktober: [Donald Nolet "Kryptogramm"](https://www.lovelybooks.de/autor/Donald-Nolet/Kryptogramm-1446021747-w/) -* November: [George Orwell "1984"](https://www.lovelybooks.de/autor/George-Orwell/1984-60655376-w/) -* Dezember: [Arkadi Strugatzki "Picknick am Wegesrand"](https://www.lovelybooks.de/autor/Arkadi-Strugatzki/Picknick-am-Wegesrand-144344970-w/) + $ target/buchdesmonats-1.7-standalone.jar [book|comic] + +## Authors -## 2016 - -* Januar: [Miriam Meckel "NEXT"](https://www.lovelybooks.de/autor/Miriam-Meckel/NEXT-681685074-w/) -* Februar: [Malte Spitz "Was macht ihr mit meinen Daten"](https://www.lovelybooks.de/autor/Malte-Spitz/Was-macht-ihr-mit-meinen-Daten-1210655732-w/) -* März: [Douglas Coupland "Microsklaven"](https://www.lovelybooks.de/autor/Douglas-Coupland/Microsklaven-63436040-w/) -* April: [Jon Erickson "Hacking"](https://www.lovelybooks.de/autor/Jon-Erickson/Hacking-327764409-w/) -* Mai: [Tsutomu Shimomura "Data Zone"](https://www.lovelybooks.de/autor/Tsutomu-Shimomura/Data-Zone-143918980-w/) -* Juni: [Christian Humberg "Sorge dich nicht, beame!"](https://www.lovelybooks.de/autor/Christian-Humberg/Sorge-dich-nicht-beame-1008414075-t/) -* Juli: [Gene Kim "Phoenix-Projekt: Der Roman über IT und DevOps"](https://www.lovelybooks.de/autor/Gene-Kim/Phoenix-Projekt-Der-Roman-%C3%BCber-IT-und-DevOps-Neue-Erfolgsstrategien-f%C3%BCr-Ihre-Firma-1198383355-w/) -* August: [Clifford Stoll "Kuckucksei"](https://www.lovelybooks.de/autor/Clifford-Stoll/Kuckucksei-1207152733-w/) -* September: [Georg Milzner "Digitale Hysterie"](https://www.lovelybooks.de/autor/Georg-Milzner/Digitale-Hysterie-1208944640-w/) -* Oktober: [Jamie -Bartlett "The Dark Net"](https://www.lovelybooks.de/autor/Jamie-Bartlett/The-Dark-Net-1180167377-w/) -* November: [Jaron Lanier "Wem gehört die Zukunft?"](https://www.lovelybooks.de/autor/Jaron-Lanier/Wem-geh%C3%B6rt-die-Zukunft-1090233300-w/) -* Dezember: [Federico Biancuzzi "Visionäre der Programmierung: Die Sprachen und ihre Schöpfer"](https://www.lovelybooks.de/autor/Federico-Biancuzzi/Vision%C3%A4re-der-Programmierung-Die-Sprachen-und-ihre-Sch%C3%B6pfer-353682781-w/) - -## 2015 - -* Januar: [Nicolas Beaujouan "Geek"](https://www.lovelybooks.de/autor/Nicolas-Beaujouan/Geek-1116762710-t/) -* Februar: [Michael Seemann "Das neue Spiel"](https://www.lovelybooks.de/autor/Michael-Seemann/Das-neue-Spiel-1106924192-t/) -* März: [Karl Olsberg "Das Dorf Band 1: Der Fremde"](https://www.lovelybooks.de/autor/Karl-Olsberg/Das-Dorf-Band-1-Der-Fremde-1130986058-t/) -* April: [Steven Levy "Hackers"](https://www.lovelybooks.de/autor/Steven-Levy/Hackers-384682145-w/) -* Mai: [Aleks Krotoski "Untangling the Web"](https://www.lovelybooks.de/autor/Aleks-Krotoski/Untangling-the-Web-1048300181-t/) -* Juni: [Christian Humberg "In 80 Welten durch den Tag"](https://www.lovelybooks.de/autor/Christian-Humberg/In-80-Welten-durch-den-Tag-1134811726-t/) -* Juli: [Nicole Dornseif "Eltern sein - kurz & geek"](https://www.lovelybooks.de/autor/Nicole-Dornseif/Eltern-sein-kurz-geek-975529216-t/) -* August: [Gottfried Wolmeringer "Coding for Fun"](https://www.lovelybooks.de/autor/Gottfried-Wolmeringer/Coding-for-Fun-1014994768-w/) -* September: [Charles Stross "Die Kinder des Saturn"](https://www.lovelybooks.de/autor/Charles-Stross/Die-Kinder-des-Saturn-223640896-w/) -* Oktober: [Daniel Suarez "Kill Decision"](https://www.lovelybooks.de/autor/Daniel-Suarez/Kill-Decision-973707573-w/) -* November: [Tom Hillenbrand "Drohnenland"](https://www.lovelybooks.de/autor/Tom-Hillenbrand/Drohnenland-1084157364-w/) -* Dezember: [H. G. Wells "Die Zeitmaschine"](https://www.lovelybooks.de/autor/H.-G.-Wells/Die-Zeitmaschine-485947391-w/) - -## 2014 - -* Januar: [Karl Olsberg "Würfelwelt"](https://www.lovelybooks.de/autor/Karl-Olsberg/Würfelwelt-Ein-Minecraft-Roman-1054644236-t/) -* Februar: [Dave Eggers "The Circle"](https://www.lovelybooks.de/autor/Dave-Eggers/The-Circle-1054838179-t/) -* März: [Karl Olsberg "Zurück in die Würfelwelt"](https://www.lovelybooks.de/autor/Karl-Olsberg/Zurück-in-die-Würfelwelt-Ein-Minecraft-Roman-1083709423-t/) -* April: [John Scalzi "Redshirts"](https://www.lovelybooks.de/autor/John-Scalzi/Redshirts-Roman-1080431773-w/) -* Mai: [Nicholas Negroponte "Total Digital"](https://www.lovelybooks.de/autor/Nicholas-Negroponte/Total-digital-143063530-w/) -* Juni: [Marc Elsberg "ZERO"](https://www.lovelybooks.de/autor/Marc-Elsberg/ZERO-Sie-wissen-was-du-tust-1072286884-w/) -* Juli: [Marc Elsberg "BLACKOUT"](https://www.lovelybooks.de/autor/Marc-Elsberg/BLACKOUT-Morgen-ist-es-zu-sp%C3%A4t-801811611-w/) -* August: [Ed Piskor "Wizzywig"](https://www.lovelybooks.de/autor/Ed-Piskor/Wizzywig-1069042585-t/) -* September: [Rosenbach/Stark "Der NSA-Komplex"](https://www.lovelybooks.de/autor/Marcel-Rosenbach/Der-NSA-Komplex-Edward-Snowden-und-der-Weg-in-die-totale-%C3%9Cberwachung-1089051151-t/) -* Oktober: [Randall Munroe "What if?"](https://www.lovelybooks.de/autor/Randall-Munroe/What-if-Was-w%C3%A4re-wenn-Wirklich-wissenschaftliche-Antworten-auf-absurde-hypothetische-Fragen-1110788589-t/) -* November: [Daniel Suarez "Control"](https://www.lovelybooks.de/autor/Daniel-Suarez/Control-1112506491-w/) -* Dezember: [John Brunner "Der Schockwellenreiter"](https://www.lovelybooks.de/autor/John-Brunner/Der-Schockwellenreiter-1280382149-w/) - - -## 2013 - -* Januar: [Passig/Lobo "Internet - Segen oder Fluch"](https://www.lovelybooks.de/autor/Kathrin-Passig/Internet-Segen-oder-Fluch-989584306-w/) -* Februar: [Mercedes Bunz "Die stille Revolution"](https://www.lovelybooks.de/autor/Mercedes-Bunz/Die-stille-Revolution-992377364-w/) -* März: [Johnny Haeusler "Netzgemüse"](https://www.lovelybooks.de/autor/Johnny-Haeusler/Netzgemuese-1179581643-w/) -* April: [Alois Potton "Abgründe der Informatik"](https://www.lovelybooks.de/autor/Alois-Potton/Abgrunde-der-Informatik-723381327-t/) -* Mai: [Andrew Blum "Kabelsalat"](https://www.lovelybooks.de/autor/Andrew-Blum/Kabelsalat-952358745-w/) -* Juni: [Neal Stephenson "Cryptonomicon"](https://www.lovelybooks.de/autor/Neal-Stephenson/Cryptonomicon-41092438-w/) -* Juli: [Neal Stephenson "Snow Crash"](https://www.lovelybooks.de/autor/Neal-Stephenson/Snow-Crash-41288882-w/) -* August: [Hilmar Schmundt "Hightechmärchen"](https://www.lovelybooks.de/autor/Hilmar-Schmundt/Hightechmärchen-Die-schönsten-Mythen-aus-dem-Morgen-Land-1054591283-t/) -* September: [Georg Seesslen "Die Matrix entschlüsselt"](https://www.lovelybooks.de/autor/Georg-Seeßlen/Die-Matrix-entschlüsselt-143092240-w/) -* Oktober: [Dirk von Gehlen "Eine neue Version ist verfügbar"](https://www.lovelybooks.de/autor/Dirk-von-Gehlen/Eine-neue-Version-ist-verf%C3%BCgbar-Update-1042916407-t/) -* November: [Julian Assange "Cypherpunks"](https://www.lovelybooks.de/autor/Julian-Assange/Cypherpunks-1019474597-t/) -* Dezember: [McKenzie Wark "Das Hacker-Manifest - A Hacker Manifesto"](https://www.lovelybooks.de/autor/McKenzie-Wark/Das-Hacker-Manifest-A-Hacker-Manifesto-145081610-w/) - - -## 2012 - -* Januar: [Ganz, Ohlig, Vollnhals "Hackerbrause - kurz & geek"](https://www.lovelybooks.de/autor/Ganz/Hackerbrause-kurz-geek-836913255-w/) -* Februar: [Shumeet Baluja "Silicon Jungle"](https://www.lovelybooks.de/autor/Shumeet-Baluja/Silicon-Jungle-908098408-w/) -* März: [Ole Reissmann "We are Anonymous"](https://www.lovelybooks.de/autor/Ole-Reissmann/We-are-Anonymous-906289132-w/) -* April: [David Kyle Johnson "Inception and Philosophy"](https://www.lovelybooks.de/autor/David-Kyle-Johnson/Inception-and-Philosophy-716401793-w/) -* Mai: [Constantin Gillies "Extraleben"](https://www.lovelybooks.de/autor/Constantin-Gillies/Extraleben-145091940-w/) -* Juni: [Ernest Cline "Ready Player One"](https://www.lovelybooks.de/autor/Ernest-Cline/Ready-Player-One-885602889-w/) -* Juli: [Markus Beckedahl "Die digitale Gesellschaft"](https://www.lovelybooks.de/autor/Markus-Beckedahl/Die-digitale-Gesellschaft-950641212-w/) -* August: [Dirk von Gehlen "Mashup"](https://www.lovelybooks.de/autor/Dirk-von-Gehlen/Mashup-950293232-w/) -* September: [Konrad Lischka "Spielplatz Computer"](https://www.lovelybooks.de/autor/Konrad-Lischka/Spielplatz-Computer-142819380-w/) -* Oktober: [Jörg Luibl "Spielefresser, Biomonster & Fanboys"](https://www.lovelybooks.de/autor/Jörg-Luibl/Spielefresser-Biomonster-Fanboys-143311130-w/) -* November: [Bartmann "Durchstarten mit Raspberry Pi"](https://www.lovelybooks.de/autor/Erik-Bartmann/Durchstarten-mit-Raspberry-Pi-974816231-w/) -* Dezember: [Andreas Eschbach "Herr aller Dinge"](https://www.lovelybooks.de/autor/Andreas-Eschbach/Herr-aller-Dinge-697173922-w/) - -## 2011 - -* Januar: [Matthias Becker "Datenschatten"](https://www.lovelybooks.de/autor/Matthias-Becker/Datenschatten-375551986-w/) -* Februar: [Cory Doctorow "Little Brother"](https://www.lovelybooks.de/autor/Cory-Doctorow/Little-Brother-224419413-w/) -* März: [Marcel Rosenbach "Staatsfeind WikiLeaks"](https://www.lovelybooks.de/autor/Marcel-Rosenbach/Staatsfeind-WikiLeaks-Wie-eine-Gruppe-von-Netzaktivisten-die-mächtigsten-Nationen-der-Welt-herausfordert-Ein-SPIEGEL-Buch-498953500-w/) -* April: [Dreyfus/Assange "Underground"](https://www.lovelybooks.de/autor/Suelette-Dreyfus/Underground-Die-Geschichte-der-frühen-Hacker-Elite-Tatsachenroman-562945888-w/) -* Mai: [Daniel Suarez "Darknet"](https://www.lovelybooks.de/autor/Daniel-Suarez/DARKNET-593966808-w/) -* Juni: [Kurz/Rieger "Die Datenfresser"](https://www.lovelybooks.de/autor/Constanze-Kurz/Die-Datenfresser-Wie-Internetfirmen-und-Staat-sich-unsere-persönlichen-Daten-einverleiben-und-wie-wir-die-Kontrolle-darüber-zurückerlangen-588023257-w/) -* Juli: [Eckenfels/Hildebrandt "Das Kochbuch für Geeks"](https://www.lovelybooks.de/autor/Petra-Hildebrandt/Das-Kochbuch-für-Geeks-145346990-w/) -* August: [Arduino - Physical Computing für Bastler, Designer und Geeks](https://www.lovelybooks.de/autor/Manuel-Odendahl/Arduino-Physical-Computing-f%C3%BCr-Bastler-Designer-und-Geeks-404199108-w/) -* September: [Stöcker - Nerd Attack!](https://www.lovelybooks.de/autor/Christian-Stöcker/Nerd-Attack-739587097-w/) -* Oktober: [Douglas Coupland - "JPod"](https://www.lovelybooks.de/autor/Douglas-Coupland/JPod-63433499-w/) -* November: [Daniel Domscheit-Berg, Tina Klopp - "Inside WikiLeaks"](https://www.lovelybooks.de/autor/Daniel-Domscheit--Berg-/Inside-WikiLeaks-532707880-w/) -* Dezember: [Klaus Raab - "Wir sind online - wo seid ihr?"](https://www.lovelybooks.de/autor/Klaus-Raab/Wir-sind-online-wo-seid-ihr-589478484-w/) - -## 2010 - -* Oktober: [Charles Stross "Du bist tot"](https://www.lovelybooks.de/autor/Charles-Stross/Du-bist-tot-313822071-w/) -* November: [Daniel Suarez "Daemon: Die Welt ist nur ein Spiel"](https://www.lovelybooks.de/autor/Daniel-Suarez/Daemon-Die-Welt-ist-nur-ein-Spiel-238972300-w/) -* Dezember: [William Gibson "Quellcode"](https://www.lovelybooks.de/autor/William-Gibson/Quellcode-137242490-w/) +* Programming: [Aaron Fischer](https://aaron-fischer.net/) +* Content: [Michael Reutter](https://social.okoyono.de/@mezzo) diff --git a/project.clj b/project.clj index eaea4b9..bbdaa86 100644 --- a/project.clj +++ b/project.clj @@ -1,5 +1,5 @@ -(defproject buchdesmonats "1.6" - :description "A simple tool to fetch all book of the month covers from the okoyono.de project." +(defproject buchdesmonats "1.7" + :description "A simple tool to fetch covers of the month from the okoyono.de project." :url "https://git.okoyono.de/mezzomix/buch_des_monats" :license {:name "MIT License" :url "http://opensource.org/licenses/MIT"} diff --git a/public/styles.css b/public/book.css similarity index 89% rename from public/styles.css rename to public/book.css index 3754573..e68cd06 100644 --- a/public/styles.css +++ b/public/book.css @@ -1,5 +1,3 @@ -@import url(http://fonts.googleapis.com/css?family=Gilda+Display); - body { background-color: #f5efdb; } @@ -43,4 +41,4 @@ body > p, .cover-item img { width: 265px; vertical-align: top; -} \ No newline at end of file +} diff --git a/src/buchdesmonats/layout_book b/public/book.html similarity index 82% rename from src/buchdesmonats/layout_book rename to public/book.html index bf38470..7194023 100644 --- a/src/buchdesmonats/layout_book +++ b/public/book.html @@ -1,9 +1,9 @@ - + okoyono.de -- Buch des Monats - + @@ -23,10 +23,9 @@ Ein økoyono Projekt.

-
- - LovelyBooks cover - -
+
+ LovelyBooks cover +
+
diff --git a/public/comic.css b/public/comic.css new file mode 100644 index 0000000..e68cd06 --- /dev/null +++ b/public/comic.css @@ -0,0 +1,44 @@ +body { + background-color: #f5efdb; +} + +h1 { + color: #7D5D5E; + text-align: center; + font-family: 'Gilda Display', serif; + font-size: 6em; +} + +a { + color: #3F544B; +} +a:hover { + text-decoration: none; + color: black; +} + +body > p { + width: 70%; + border-top: 3px solid #3F544B; + padding: 5px 0 25px 0; + font-family: 'Gilda Display', serif; +} + +body > p, +#covers { + margin: auto; +} + +.cover-item { + width: 265px; + margin-bottom: 5px; + border: 1px solid #FFE5C6; +} +.cover-item:hover { + opacity: 0.7; +} + +.cover-item img { + width: 265px; + vertical-align: top; +} diff --git a/public/comic.html b/public/comic.html new file mode 100644 index 0000000..d78a010 --- /dev/null +++ b/public/comic.html @@ -0,0 +1,28 @@ + + + + + okoyono.de -- Comic des Monats + + + + + + + +

Comic des Monats

+

Handerlesen und für gut befunden seit 2018 + von . Jeden Monat ein neuer Comic aus seiner Sammlung. Die Buchcover stammen + von Lovely + Books, der + Code von Aaron Fischer. + Ein økoyono Projekt.

+ +
+
+ LovelyBooks cover +
+
+ + diff --git a/src/buchdesmonats/layout.html b/src/buchdesmonats/book.html similarity index 96% rename from src/buchdesmonats/layout.html rename to src/buchdesmonats/book.html index bf38470..0527ba3 100644 --- a/src/buchdesmonats/layout.html +++ b/src/buchdesmonats/book.html @@ -3,7 +3,7 @@ okoyono.de -- Buch des Monats - + diff --git a/src/buchdesmonats/layout_comic b/src/buchdesmonats/comic.html similarity index 95% rename from src/buchdesmonats/layout_comic rename to src/buchdesmonats/comic.html index 5504c3d..3e04124 100644 --- a/src/buchdesmonats/layout_comic +++ b/src/buchdesmonats/comic.html @@ -3,7 +3,7 @@ okoyono.de -- Comic des Monats - + diff --git a/src/buchdesmonats/core.clj b/src/buchdesmonats/core.clj index 9020eb0..bc0eaf8 100644 --- a/src/buchdesmonats/core.clj +++ b/src/buchdesmonats/core.clj @@ -26,6 +26,7 @@ [clojure.tools.logging :as log] [me.raynes.fs :as fs])) +;; TODO: Make it compatible to other book cover sites (defn imgurl->bytes [lovelybooks-url] (let [urls (-> (java.net.URL. lovelybooks-url) html/html-resource @@ -37,7 +38,6 @@ stream (http-client/get url-to-fetch {:as :byte-array})] (:body stream))) - (defn encode-url-part [part] (java.net.URLEncoder/encode part "UTF-8")) @@ -69,33 +69,37 @@ (with-open [out (io/output-stream target-file)] (.write out bytes))) (catch Exception e + ;; TODO: Better exception (examine e?) (log/info "Problems with " url ", skip it.")))) (defn find-missing-covers [books-url target-dir] (remove #(fs/exists? (url->file % target-dir)) (scrape-book-urls books-url))) -(html/defsnippet cover-item-model "buchdesmonats/layout.html" [:div#covers :> :div] +(defn cover-item-model-for-type [type] +(html/defsnippet cover-item-model (str "buchdesmonats/" type ".html") [:div#covers :> :div] [link title] [:a] (html/set-attr :href link) - [:img] (html/set-attr :src (url->file link "book-covers") :title title)) + [:img] (html/set-attr :src (url->file link (str type "-covers")) :title title))) -(html/deftemplate index-template "buchdesmonats/layout.html" +(defn template-for-type [type] +(html/deftemplate book-template (str "buchdesmonats/" type ".html") [cover-urls] [:#covers] (html/content - (map #(cover-item-model % "zu Lovely Books") - cover-urls))) + (map #((cover-item-model-for-type type) % "zu Lovely Books") + cover-urls)))) -(defn generate-html [book-urls target-dir] - (let [content (apply str (index-template book-urls))] - (with-open [out (io/writer (io/file "public" "index.html"))] +(defn generate-html [type book-urls target-dir] + (let [content (apply str ((template-for-type type) book-urls))] + (with-open [out (io/writer (io/file target-dir (str type ".html")))] (.write out content)))) (defn -main [& args] - (let [datasource-url "https://git.okoyono.de/mezzomix/buch_des_monats/raw/master/README.mkd" - target-dir (io/file "public" "book-covers")] + (let [type (first args) + datasource-url (str "https://git.okoyono.de/mezzomix/buch_des_monats/raw/master/" (clojure.string/upper-case type) ".mkd") + target-dir (io/file "public" (str type "-covers"))] (fs/mkdirs target-dir) - (generate-html (scrape-book-urls datasource-url) "public") + (generate-html type (scrape-book-urls datasource-url) "public") (doall (pmap #(scrape-book-cover % target-dir) (find-missing-covers datasource-url target-dir))) (System/exit 0)))