|
@@ -50,7 +50,7 @@ public class CSVWiggler {
|
|
String message = msg.getString("content", "");
|
|
String message = msg.getString("content", "");
|
|
|
|
|
|
int len = message.length();
|
|
int len = message.length();
|
|
- String timestamp = msg.getString("timestamp", "");//.substring(0, 19);
|
|
|
|
|
|
+ String timestamp = msg.getString("timestamp", "").substring(0, 19);
|
|
int cookiecount = 0;
|
|
int cookiecount = 0;
|
|
String type = "default";
|
|
String type = "default";
|
|
if (isEventSys) {
|
|
if (isEventSys) {
|
|
@@ -68,7 +68,14 @@ public class CSVWiggler {
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- //TODO edgecase-kekse
|
|
|
|
|
|
+ if (title.equals("Ein Cookie!"))
|
|
|
|
+ {
|
|
|
|
+ type = "cookie";
|
|
|
|
+ JsonArray fields = embed.get("fields").asArray();
|
|
|
|
+ JsonObject countField = fields.get(0).asObject();
|
|
|
|
+ String cntS = countField.getString("value","0");
|
|
|
|
+ cookiecount = Integer.valueOf(cntS);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -113,7 +120,7 @@ public class CSVWiggler {
|
|
String tsMinutely = splitted[4].substring(0, 16);
|
|
String tsMinutely = splitted[4].substring(0, 16);
|
|
if(!previousLineTS.equals(tsMinutely))
|
|
if(!previousLineTS.equals(tsMinutely))
|
|
{
|
|
{
|
|
- SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd_hh:mm");
|
|
|
|
|
|
+ SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd_HH:mm");
|
|
if(previousLineTS.length()>0)//suppress calc on head of file
|
|
if(previousLineTS.length()>0)//suppress calc on head of file
|
|
{
|
|
{
|
|
int minutesToSynthesize = 0;
|
|
int minutesToSynthesize = 0;
|
|
@@ -122,11 +129,15 @@ public class CSVWiggler {
|
|
Instant calc= old.toInstant();
|
|
Instant calc= old.toInstant();
|
|
Date current = parser.parse(tsMinutely.replace("T","_"));
|
|
Date current = parser.parse(tsMinutely.replace("T","_"));
|
|
Long gap = ChronoUnit.MINUTES.between(old.toInstant(),current.toInstant());
|
|
Long gap = ChronoUnit.MINUTES.between(old.toInstant(),current.toInstant());
|
|
- System.out.println("Gap:"+gap);
|
|
|
|
- for(int g=1;g<gap;g++)
|
|
|
|
|
|
+ if(gap>1)
|
|
{
|
|
{
|
|
- String ts = parser.format(Date.from(calc.plus(g, ChronoUnit.MINUTES)));
|
|
|
|
- w2.println("0;0;"+ts);
|
|
|
|
|
|
+ System.out.println("Gap:"+gap+"||"+previousLineTS+"|"+tsMinutely);
|
|
|
|
+ System.out.println(">>"+old+"|"+current);
|
|
|
|
+ for(int g=1;g<gap;g++)
|
|
|
|
+ {
|
|
|
|
+ String ts = parser.format(Date.from(calc.plus(g, ChronoUnit.MINUTES)));
|
|
|
|
+ w2.println("0;0;"+(ts.replace("_","T")));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} catch (ParseException e) {
|
|
} catch (ParseException e) {
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|