Compare commits
5 Commits
590953d9bc
...
3299636a46
Author | SHA1 | Date | |
---|---|---|---|
|
3299636a46 | ||
|
7985cf3c5d | ||
|
631dcfde48 | ||
|
c445b988e8 | ||
|
00fdce204e |
14
api/index.php
Normal file
14
api/index.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php include('../templates/header.php'); ?>
|
||||||
|
<div class='window'>
|
||||||
|
<div class='window-bar'>
|
||||||
|
<span>moodblog API</span>
|
||||||
|
</div>
|
||||||
|
<div class='window-content'>
|
||||||
|
<ul>
|
||||||
|
<li><a href="shields-posts.php">shields.io posts endpoint</a></li>
|
||||||
|
<li><a href="shields-mood.php">shields.io mood endpoint</a></li>
|
||||||
|
<li><a href="shields-tunes.php">shields.io tunes endpoint</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php include('../templates/footer.php'); ?>
|
18
api/shields-mood.php
Normal file
18
api/shields-mood.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
require "../templates/config.php";
|
||||||
|
?>
|
||||||
|
{
|
||||||
|
"schemaVersion": 1,
|
||||||
|
"label": "current mood",
|
||||||
|
"color": "lightgrey",
|
||||||
|
<?php
|
||||||
|
require "../creds.php";
|
||||||
|
|
||||||
|
$result = mysqli_query($mysqli, "SELECT Mood FROM articles ORDER BY ID DESC LIMIT 1");
|
||||||
|
|
||||||
|
while($res = mysqli_fetch_array($result)) {
|
||||||
|
echo ' "message": "'.$res['Mood'].'"',"\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
}
|
18
api/shields-posts.php
Normal file
18
api/shields-posts.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
require "../templates/config.php";
|
||||||
|
?>
|
||||||
|
{
|
||||||
|
"schemaVersion": 1,
|
||||||
|
"label": "blog posts",
|
||||||
|
"color": "lightgrey",
|
||||||
|
<?php
|
||||||
|
require "../creds.php";
|
||||||
|
|
||||||
|
$result = mysqli_query($mysqli, "SELECT COUNT(ID) FROM articles");
|
||||||
|
|
||||||
|
while($res = mysqli_fetch_array($result)) {
|
||||||
|
echo ' "message": "'.$res['COUNT(ID)'].'"',"\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
}
|
18
api/shields-tunes.php
Normal file
18
api/shields-tunes.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
require "../templates/config.php";
|
||||||
|
?>
|
||||||
|
{
|
||||||
|
"schemaVersion": 1,
|
||||||
|
"label": "current tunes",
|
||||||
|
"color": "lightgrey",
|
||||||
|
<?php
|
||||||
|
require "../creds.php";
|
||||||
|
|
||||||
|
$result = mysqli_query($mysqli, "SELECT Song FROM articles ORDER BY ID DESC LIMIT 1");
|
||||||
|
|
||||||
|
while($res = mysqli_fetch_array($result)) {
|
||||||
|
echo ' "message": "'.$res['Song'].'"',"\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user