forked from kokonior/PHP-Projects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquotesmoment.php
51 lines (39 loc) · 1.24 KB
/
quotesmoment.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
$judul = "
\033[01;31m ___ _ _ _
( _`\ (_ ) ( )_ ( )
| ( (_) | | _ _ ___ | ,_)| |__ ___ ___ __
| | _ | | ( ) ( ) /'___)| | | _ `\ /' _ ` _ `\ /'__`\ \033[0m
| (_( ) | | | (_) |( (___ | |_ | | | | _ | ( ) ( ) |( ___/
(____/'(___)`\___/'`\____)`\__)(_) (_)(_)(_) (_) (_)`\____)
Quotes Bullshit Maker - Made By : https://github.com/CluthcM3
";
class quotes
{
function quotes_anjay()
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://type.fit/api/quotes");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$ress = curl_exec($ch);
curl_close($ch);
$decode = json_decode($ress);
echo "Isi 1 - 1642 : ";
$inp = trim(fgets(STDIN));
if (!is_numeric($inp))
{
echo "\nDi isi gblog" . PHP_EOL;
} else
{
for ($i=0 ; $i < $inp ; $i++)
{
$no = $i + 1;
$randomquotes = array_rand($decode);
echo "$no. {$decode[$randomquotes]->author} - {$decode[$randomquotes]->text}" . PHP_EOL;
}
}
}
}
$result = new quotes();
echo $judul . PHP_EOL;
$result->quotes_anjay();