commit 00faf31c821709660e73afb465cb0403d28b6a05 Author: nyyu Date: Tue Oct 9 19:32:11 2018 +0200 init diff --git a/DevFest Nantes 2018.html b/DevFest Nantes 2018.html new file mode 100644 index 0000000..3cb8905 --- /dev/null +++ b/DevFest Nantes 2018.html @@ -0,0 +1,9445 @@ + + +DevFest Nantes 2018

October 18-19, 2018

Code to infinity & beyond!

See how it was in 2017
Buy ticket

Blog

NEIL ARMSTRONG
"THAT'S ONE STEP FOR MAN, ONE GIANT LEAP FOR MANKIND"

Speaker Information

NEIL ARMSTRONG
"HUSTON, TRANQUILITY BASE HERE THE EAGLE HAS LANDED"

Speakers

SALLY RIDE
"THE STARS DON'T LOOK BIGGER, BUT THEY LOOK BRIGHTER"

Schedule

APOLLO 13 RESCUE MISSION
"FAILURE IS NOT AN OPTION"

Attending

NEIL ARMSTRONG
"HUSTON, TRANQUILITY BASE HERE THE EAGLE HAS LANDED"

Team

RON GARAN
"WE ARE LIMITED ONLY BY OUR IMAGINATION AND OUR WILL TO ACT"

FAQ

JACK SWIGERT, APOLLO 13
"OK HUSTON, WE'VE HAD A PROBLEM HERE"

Code of Conduct

NEIL ARMSTRONG
"WE CAME IN PEACE FOR ALL MANKIND"
1800Attendees per day
2Days
4Parallel tracks
70Sessions
81Speakers
THE + developer festival organized by developers! All about Mobile, IoT, Web +and Cloud presented by experts from around the world for one of the +largest technical conferences.

Organizers

GDG Nantes is proud to organize the DevFest Nantes.
And a big thank you for our volunteers, students of Epitech Nantes

+
Open team page

What is GDG?

Google + Developers Group (GDG) - is open and volunteer geek community who +create exciting projects and share experience about Google technologies +with a passion

+

Tickets

20€
May 1 - Oct 17
Reduced Price *
Sold Out
70€
May 1 - Jun 30

Blind tickets 🙈

+
Early Bird
Sold Out
90€
July 1st -

Hurry up! 🙊

+
Lazy Bird
Tickets grant access during 2 days to all conference sections, coffee breaks, lunch and party.
Buy ticket

Latest news

Mot du sponsor vpTech

Merci au sponsor vpTech pour son soutien.

+
Continue reading
Mot du sponsor Zenika

Merci au sponsor Zenika pour son soutien.

+
Continue reading
>
Cité des Congrès, Nantes
Located + in the center of Nantes, the event takes place in the "Cité des +Congrès" with more than 3000m² of conference rooms, hand's on and +networking space...
5 rue de Valmy
44000 Nantes, France

Partners

Platinium
After-Party
Gold
Partners
Become a partner
  • GDE
Juarez FILHOIreland
ERS
Skills:FirebaseWeb

First Firebase GDE in South America.

+
General
💡 Discovery
🌍 Web
📱 Mobile & IoT
🤖 BigData & AI
☁️ Cloud & DevOps
💚 UX / UI
📝 Languages
🐱‍💻 SECURITY
\ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..ca95d4e --- /dev/null +++ b/pom.xml @@ -0,0 +1,40 @@ + + 4.0.0 + tk.nyyu + devfest2018 + 0.0.1-SNAPSHOT + + + org.jsoup + jsoup + 1.11.3 + + + org.apache.poi + poi-ooxml + 4.0.0 + + + com.google.code.gson + gson + 2.8.5 + + + commons-io + commons-io + 2.6 + + + org.apache.logging.log4j + log4j-core + 2.11.1 + + + org.apache.commons + commons-lang3 + 3.8.1 + + + \ No newline at end of file diff --git a/src/main/java/Program.java b/src/main/java/Program.java new file mode 100644 index 0000000..4cdd81d --- /dev/null +++ b/src/main/java/Program.java @@ -0,0 +1,126 @@ +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.URL; +import java.nio.charset.Charset; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.ClientAnchor; +import org.apache.poi.ss.usermodel.Comment; +import org.apache.poi.ss.usermodel.CreationHelper; +import org.apache.poi.ss.usermodel.Drawing; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.VerticalAlignment; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.select.Elements; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +public class Program { + + private static final Logger logger = LogManager.getLogger(Program.class); + + public static void main(String[] args) throws IOException, InvalidFormatException { + + Document doc = Jsoup.parse(new File("DevFest Nantes 2018.html"), "UTF-8"); + + JsonObject sessions = new JsonParser().parse( + IOUtils.toString(new URL("https://devfest.gdgnantes.com/data/sessions.json"), Charset.forName("UTF-8"))) + .getAsJsonObject(); + XSSFWorkbook workBook = new XSSFWorkbook(); + + CreationHelper factory = workBook.getCreationHelper(); + + CellStyle styleWrap = workBook.createCellStyle(); + styleWrap.setWrapText(true); + styleWrap.setAlignment(HorizontalAlignment.CENTER); + styleWrap.setVerticalAlignment(VerticalAlignment.CENTER); + + for (int i = 1; i <= 2; i++) { + Map>> map = new LinkedHashMap>>(); + + Elements timeSlots = doc.select("schedule-day[name=day" + i + "] .timeslot"); + for (Element timeSlot : timeSlots) { + String time = timeSlot.select(".hours").text() + ":" + timeSlot.select(".minutes").text(); + + List> list = map.get(time); + if (list == null) + list = new LinkedList>(); + + Elements contents = timeSlot.select(".session-content"); + for (Element content : contents) { + String title = content.select(".session-title").text(); + String id = content.parent().parent().parent().select("a").attr("href").split("=")[1]; + String type = sessions.getAsJsonObject(id).get("type").getAsString(); + JsonElement cat = sessions.getAsJsonObject(id).get("category"); + JsonElement comp = sessions.getAsJsonObject(id).get("complexity"); + JsonElement lang = sessions.getAsJsonObject(id).get("language"); + JsonElement desc = sessions.getAsJsonObject(id).get("description"); + + String details = String.format("type: %s, category: %s, complexity: %s, language: %s\n\n%s", type, + cat != null ? cat.getAsString() : null, comp != null ? comp.getAsString() : null, + lang != null ? lang.getAsString() : null, desc != null ? desc.getAsString() : null); + + list.add(new ImmutablePair(title, details)); + logger.info("{} -> {}", time, title); + } + + map.put(time, list); + } + + XSSFSheet sheet = workBook.createSheet(); + workBook.setSheetName(i - 1, "Day " + i); + int rownum = 0; + for (Map.Entry>> entry : map.entrySet()) { + + Row row = sheet.createRow(rownum++); + + int cellnum = 0; + Cell cell = row.createCell(cellnum++); + cell.setCellValue(entry.getKey()); + + for (ImmutablePair value : entry.getValue()) { + cell = row.createCell(cellnum++); + cell.setCellValue(value.getKey()); + cell.setCellStyle(styleWrap); + if (value.getValue() != null) { + Drawing drawing = cell.getSheet().createDrawingPatriarch(); + ClientAnchor anchor = factory.createClientAnchor(); + anchor.setCol1(cellnum); + anchor.setCol2(cellnum + 5); + anchor.setRow1(row.getRowNum()); + anchor.setRow2(row.getRowNum() + 8); + Comment comment = drawing.createCellComment(anchor); + comment.setString(factory.createRichTextString(value.getValue())); + cell.setCellComment(comment); + } + sheet.setColumnWidth(cellnum - 1, 1024 * 5); + } + if (cellnum > 2) + sheet.createRow(rownum++); + } + + } + + workBook.write(new FileOutputStream(new File(doc.title() + ".xlsx"))); + workBook.close(); + } + +} diff --git a/src/main/resources/log4j2-test.xml b/src/main/resources/log4j2-test.xml new file mode 100644 index 0000000..09a6604 --- /dev/null +++ b/src/main/resources/log4j2-test.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + \ No newline at end of file