Skip to content

Commit

Permalink
update para agenda lula
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-hos committed Jan 23, 2023
1 parent fa9255b commit 3793f39
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 36 deletions.
11 changes: 6 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
<artifactId>agenda-presidentes</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<compiler-plugin.version>3.10.1</compiler-plugin.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus-plugin.version>1.13.4.Final</quarkus-plugin.version>
<quarkus-plugin.version>2.15.3.Final</quarkus-plugin.version>
<quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>1.13.4.Final</quarkus.platform.version>
<quarkus.platform.version>2.15.3.Final</quarkus.platform.version>
<surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
</properties>
<dependencyManagement>
Expand Down Expand Up @@ -55,6 +55,7 @@
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.15.3</version>
</dependency>

<dependency>
Expand Down
46 changes: 18 additions & 28 deletions src/main/java/org/sjcdigital/services/Startup.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,10 @@
*/
package org.sjcdigital.services;

import java.io.IOException;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
import javax.inject.Inject;

import org.sjcdigital.model.Agenda;
import org.sjcdigital.utils.ParserUtils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -46,26 +38,24 @@ public void populate(@Observes StartupEvent ev) {
LOGGER.info("The application is starting...");


try {

LocalDate start = LocalDate.of(2019, 01, 01);
List<Agenda> agendas = new ArrayList<>();

while (!LocalDate.now().plusDays(1).isEqual(start)) {
LOGGER.info("Buscando informações: " + start);
agendas.add(scrapper.extraiDadosDoDia(start.format(ParserUtils.DATA_PATTERN_YYYY_MM_DD)));
start = start.plusDays(1);
}

LOGGER.info("Total entradas >>>> " + agendas.size());
csvParser.convertAndSaveData(agendas);

} catch (IOException e) {
e.printStackTrace();
}

summarize.geraRelatorio();
joinData.join();
/*
* try {
*
* LocalDate start = LocalDate.of(2019, 01, 01); List<Agenda> agendas = new
* ArrayList<>();
*
* while (!LocalDate.now().plusDays(1).isEqual(start)) {
* LOGGER.info("Buscando informações: " + start);
* agendas.add(scrapper.extraiDadosDoDia(start.format(ParserUtils.
* DATA_PATTERN_YYYY_MM_DD))); start = start.plusDays(1); }
*
* LOGGER.info("Total entradas >>>> " + agendas.size());
* csvParser.convertAndSaveData(agendas);
*
* } catch (IOException e) { e.printStackTrace(); }
*
* summarize.geraRelatorio(); joinData.join();
*/

}

Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Scrap Parameters
scrapper.agent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36
scrapper.timeout = 1000000
scrapper.agenda.url = https://www.gov.br/planalto/pt-br/acompanhe-o-planalto/agenda-do-presidente-da-republica/

files.path = /home/pesilva/workspace/code/pessoal/data-etl/agenda-presidente/bolsonaro/
# scrapper.agenda.url = https://www.gov.br/planalto/pt-br/acompanhe-o-planalto/agenda-do-presidente-da-republica/
scrapper.agenda.url = https://www.gov.br/planalto/pt-br/acompanhe-o-planalto/agenda-do-presidente-da-republica-lula/agenda-do-presidente-da-republica/
files.path = /home/pesilva/workspace/code/pessoal/data-etl/agenda-presidente/lula-3/

0 comments on commit 3793f39

Please sign in to comment.