This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# crontab make-crontab-send-anzahl.txt | |
# */10 * * * * /home/pi/send-anzahl-flugzeuge.sh > /dev/null | |
# ThingSpeak Write Key | |
KEY=Schreib-Key | |
ANZAHL=$(cat "/run/dump1090-mutability/aircraft.json" | jq '[.aircraft[] | select(.seen_pos)] | length'); | |
wget -q -O- "http://api.thingspeak.com/update?key=$KEY&field1=$ANZAHL&status='Update $ANZAHL Flugzeuge erfasst'" > /dev/null |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Abfrage { | |
// URL des Feeds aller Flugzeuge in Hannover von Thomas Wenzlaff. // | |
private final static String FLUGZEUG_URL = "https://api.thingspeak.com/channels/44177/feeds/last.xml"; | |
/** | |
* Start Methode. | |
* | |
* @param args | |
* keine. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> | |
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> | |
<appender name="console" class="org.apache.log4j.ConsoleAppender"> | |
<param name="Target" value="System.out"/> | |
<layout class="org.apache.log4j.PatternLayout"> | |
<param name="ConversionPattern" value="%-5p %c{1} - %m%n"/> | |
</layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in der pom.xml | |
<dependency> | |
<groupId>org.slf4j</groupId> | |
<artifactId>slf4j-api</artifactId> | |
<version>1.7.13</version> | |
</dependency> | |
<dependency> | |
<groupId>org.slf4j</groupId> | |
<artifactId>slf4j-log4j12</artifactId> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.quartz-scheduler</groupId> | |
<artifactId>quartz</artifactId> | |
<version>2.2.3</version> | |
</dependency> | |
<dependency> | |
<groupId>org.quartz-scheduler</groupId> | |
<artifactId>quartz-jobs</artifactId> | |
<version>2.2.3</version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.wenzlaff.twpubnub; | |
import static org.junit.Assert.assertEquals; | |
import java.util.Arrays; | |
import java.util.List; | |
import org.junit.Test; | |
import static java.util.stream.Collectors.joining; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.wenzlaff.twpubnub; | |
public class CheckFarben implements Farben { | |
public static void main(String[] args) { | |
CheckFarben farbe = new CheckFarben(); | |
System.out.println("Check: " + farbe.getDefaultFarbe()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.wenzlaff.twpubnub; | |
import java.awt.Color; | |
public interface Farben { | |
// - default zuerst | |
// - Methode ist automatisch public | |
// - neue Default-Methoden können in bestehenden Interfaces definiert | |
// werden, ohne dass die direkt oder indirekt abgeleiteten Klassen angepasst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void stringJoinTest() { | |
CharSequence delimiter = ","; | |
// Returns a new String composed of copies of the CharSequence elements | |
// joined together with a copy of the specified delimiter | |
String alleFarben = String.join(delimiter, "rot", "grün", "BLAU"); | |
assertEquals("rot,grün,BLAU", alleFarben); |
OlderNewer