Last active
May 31, 2025 05:50
-
-
Save kaz29/df554882bb218cece5544e305294481f to your computer and use it in GitHub Desktop.
fortee API PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "fortee-tool", | |
"type": "project", | |
"require": { | |
"guzzlehttp/guzzle": "^7.9" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__ . '/vendor/autoload.php'; | |
$client = new \GuzzleHttp\Client(); | |
$apiUrl = 'https://fortee.jp/phpcon-2025/api/proposals/accepted'; | |
$response = $client->get($apiUrl); | |
if ($response->getStatusCode() !== 200) { | |
throw new Exception('Failed to fetch speakers data'); | |
} | |
$json = json_decode($response->getBody(), true); | |
if (json_last_error() !== JSON_ERROR_NONE) { | |
throw new Exception('Failed to decode speakers data: ' . json_last_error_msg()); | |
} | |
echo "## Proposals" . PHP_EOL . PHP_EOL; | |
foreach ($json['proposals'] as $proposal) { | |
echo "- [{$proposal['title']}]({$proposal['url']}) - {$proposal['speaker']['name']}" . PHP_EOL; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__ . '/vendor/autoload.php'; | |
$client = new \GuzzleHttp\Client(); | |
$apiUrl = 'https://fortee.jp/phpcon-2025/api/sponsors'; | |
$response = $client->get($apiUrl); | |
if ($response->getStatusCode() !== 200) { | |
throw new Exception('Failed to fetch sponsors data'); | |
} | |
$json = json_decode($response->getBody(), true); | |
if (json_last_error() !== JSON_ERROR_NONE) { | |
throw new Exception('Failed to decode sponsors data: ' . json_last_error_msg()); | |
} | |
echo "## Sponsors" . PHP_EOL . PHP_EOL; | |
foreach ($json['sponsor_plans'] as $plan) { | |
echo "### {$plan['name']}" . PHP_EOL; | |
foreach ($plan['sponsors'] as $sponsor) { | |
echo "- [{$sponsor['name']}]({$sponsor['url']})" . PHP_EOL; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__ . '/vendor/autoload.php'; | |
$client = new \GuzzleHttp\Client(); | |
$apiUrl = 'https://fortee.jp/phpcon-2025/api/staff?type=structured'; | |
$response = $client->get($apiUrl); | |
if ($response->getStatusCode() !== 200) { | |
throw new Exception('Failed to fetch staffs data'); | |
} | |
$json = json_decode($response->getBody(), true); | |
if (json_last_error() !== JSON_ERROR_NONE) { | |
throw new Exception('Failed to decode staffs data: ' . json_last_error_msg()); | |
} | |
echo "## Staffs" . PHP_EOL . PHP_EOL; | |
foreach ($json['staff_types'] as $staff_type) { | |
echo "### {$staff_type['name']}" . PHP_EOL; | |
foreach ($staff_type['staff'] as $staff) { | |
echo "- ![{$staff['name']}_icon]({$staff['avatar_url']}) - [{$staff['name']}]({$staff['url']})" . PHP_EOL; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment