Docs / Bob-omb
Blog
Blog is a feature of Bob-omb used on the website.
Table of Contents
Explanation
To retrieve the data, make a GET request to the following endpoint: http://api.ftolnks.xyz/bobomb/Blog
The data is returned in JSON format. Each entry in the response represents a blog post and includes the following fields:
- id: A unique identifier for the blog post.
- name: The title of the blog post.
- text: The content of the blog post.
- date: The date of the post in
Month DD, YYYY
format.
Example
To fetch and display blog posts using PHP, you can use the following code snippet:
PHP
<?php
/**
* Blog
*
* This is a simple example on how to use the Blog API. It fetches the data and outputs every post in a unordered list. The Blog API is used for services that might need to show the LaunchShop news, so it's mostly an internal API, but we decided to share it with y'all.
* @package Bob-omb
* @author fin
* @version 1.0.0
*/
$posts = json_decode(file_get_contents('http://api.ftolnks.xyz/bobomb/Blog'), true) ?? [];
if ($posts) {
echo "<ul>";
foreach ($posts as $post) {
echo "<li><strong>" . htmlspecialchars($post['name']) . "</strong> (" . htmlspecialchars($post['date']) . "): " . htmlspecialchars($post['text']) . "</li>";
}
echo "</ul>";
} else {
echo "No blog posts found.";
}
?>
Real-Time Example
For a live example, you can see how the data appears in real-time here:
No blog posts found.