Added language page

Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
Louis Vallat 2021-06-13 01:31:31 +02:00
parent 921c23aa80
commit 25c2b3b98c
2 changed files with 13 additions and 3 deletions

12
src/languages.php Normal file
View File

@ -0,0 +1,12 @@
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, 'https://api.moviequotebot.louis-vallat.xyz/v1/languages/list');
$result = curl_exec($ch);
curl_close($ch);
$obj = json_decode($result, true);
foreach ($obj as $l) {
echo $l["alpha2_b"] . " - " . $l["english"] . "<br>";
}

View File

@ -1,8 +1,6 @@
<?php <?php
$ch = curl_init(); $ch = curl_init();
// IMPORTANT: the below line is a security risk, read https://paragonie.com/blog/2017/10/certainty-automated-cacert-pem-management-for-php-software curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
// in most cases, you should set it to true
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, 'https://api.moviequotebot.louis-vallat.xyz/v1/subtitles/list'); curl_setopt($ch, CURLOPT_URL, 'https://api.moviequotebot.louis-vallat.xyz/v1/subtitles/list');
$result = curl_exec($ch); $result = curl_exec($ch);