Skip to content

Instantly share code, notes, and snippets.

@brianglass
Created February 23, 2023 18:50
Show Gist options
  • Save brianglass/ca92f3210e273cf161542bf760f33e84 to your computer and use it in GitHub Desktop.
Save brianglass/ca92f3210e273cf161542bf760f33e84 to your computer and use it in GitHub Desktop.
PHP Orthocal Example
<?php
// Get today's information
$json = file_get_contents('https://orthocal.info/api/gregorian/');
$day = json_decode($json);
?>
<!DOCTYPE html>
<html>
<head>
<title>Daily Readings</title>
</head>
<body>
<h1><?= $day->summary_title ?></h1>
<h2>Scripture Readings</h2>
<?php foreach ($day->readings as $reading): ?>
<h3><?= $reading->display ?></h3>
<?php foreach ($reading->passage as $verse): ?>
<p>
<sup><?= $verse->verse ?></sup>
<?= $verse->content ?>
</p>
<?php endforeach; ?>
<?php endforeach; ?>
<h2>Commemorations</h2>
<?php foreach ($day->stories as $story): ?>
<h3><?= $story->title ?></h3>
<?= $story->story ?>
<?php endforeach; ?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment