Repository navigation
Functions Importer ParseImporter StreamImporter FilesImporter HTTPImporter
Florian Fehring edited this page Oct 5, 2026
·
1 revision
Der HTTPImporter dient dem Import von Dateien die mittels HTTP Protokoll erreichbar sind.
Funktionen:
- Download einer Einzeldatei
- Download eines zip- oder gz-Archives
- Import einer Einzeldatei
- Import aller Dateien des Verzeichnisses in das entpackt wurde
Nutzbar über den Konfigurationseintrag:
"importer": "HTTPImporter"
Zusätzlich ist die Angabe des zu verwendenden Parsers notwendig:
"parser": "ExampleParser"
Die Konfigurationsdatei muss für diesen Importer folgende Einstellungen beinhalten (zusätzlich zu den Standard-Einstellungen):
| Parameter | Bedeutung | Standard | optional |
|---|---|---|---|
| url | HTTP URL zur zu Importierenden Datei (oder Archiv) | - | no |
| username | Username for accessing password protected source | - | yes |
| password | Password for accessing password protected source | - | yes |
| download | If set to true the file is downloaded and archived | false | yes |
| archivefilename | Name the file should have in the archive can use {date} placeholder | - | yes |
Kann um sämtliche Konfigurationseinstellungen des FilesImporter ergänzt werden.
Simple example
This example includes the minimum configuration for the HTTPImporter
{
// Import target
"server":"http://127.0.0.1:8080/",
"smartdata":"SmartDataEnvironmental",
"storage":"public",
"collection":"minden_weather",
// Import source
"importer":"HTTPImporter",
"url":"http://api.openweathermap.org/data/2.5/weather?id=2871039&appid=1234",
// Parser configuration
"parser":"OpenWeatherMapParser"
}The source URL can contain placeholders for a date.
| Placeholder | Description |
|---|---|
| {yyyy} | The actual year |
| {MM} | The actual month |
| {dd} | The actual day (number) |
| {yyyy-X} | Actual year minus X years |
| {MM-X} | Actual month minus X month |
| {dd-X} | Actual day minus X days |
| {yyyy+X} | Actual year plus X years |
| {MM+X} | Actual month plus X month |
| {dd+X} | Actual day plus X days |
Example with date placeholders
{
// Import target
"server":"http://127.0.0.1:8080/",
"smartdata":"SmartDataEnvironmental",
"storage":"public",
"collection":"minden_weather",
// Import source
"importer":"HTTPImporter",
"url":"https://www.getdata.de/webcam/{yyyy}/{MM}/{dd-1}/",
// Parser configuration
"parser":"WebCrawlerParser"
}