Skip to content

Commit

Permalink
basic API
Browse files Browse the repository at this point in the history
  • Loading branch information
wasserbombe committed Jul 6, 2021
1 parent cf71714 commit 0080a60
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config/credentials/*
11 changes: 11 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
require_once __DIR__ . '/../lib/DB/DB.php';

$_CONFIG = array(
'database' => array(
'dbtwitter' => include __DIR__.'/credentials/db.twitter.php'
)
);

$DB_TWT = new \Interdose\DB('dbtwitter');
?>
11 changes: 11 additions & 0 deletions data/wahlprogramme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"programs": [{
"party": "CDU / CSU",
"urls": [
"https://assets.ctfassets.net/nwwnl7ifahow/4Ze4NxQZxxjpxtsHWmv0lr/678a180784a542c6b74d881526e027da/CDU_Beschluss_Das_Programm_f__r_Stabilit__t_und_Erneuerung._Gemeinsam_f__r_ein_modernes_Deutschland..pdf",
"https://www.csu.de/common/download/Regierungsprogramm.pdf"
],
"lastupdate": "2021-07-05 17:00",
"texts": []
}]
}
19 changes: 19 additions & 0 deletions stats/api.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
include __DIR__.'/../config/config.php';

$res = array(
"data" => array(),
"code" => 400,
"error" => array(),
"request" => $_REQUEST
);



http_response_code($res["code"]);
header('Content-Type: application/json');
header('Pragma: no-cache');
header('Expires: Fri, 01 Jan 1990 00:00:00 GMT');
header('Cache-Control: no-cache, no-store, must-revalidate');
echo json_encode($res, JSON_PRETTY_PRINT);
?>
Empty file added stats/cache/.placeholder
Empty file.

0 comments on commit 0080a60

Please sign in to comment.