-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.php
82 lines (79 loc) · 5.4 KB
/
api.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE HTML>
<!--
DESIGNED AND CODED
BY JERSON REYES
ONE PERSPECTIVE MEDIA | 2019
BLNDD API | 2019
https://www.blnd.ga/index.html
-->
<?php
include('handler/index.php');
?>
<html>
<head>
<title>BLND - API</title>
<link rel="STYLESHEET" href="css/main.css"></link>
<link rel="SHORTCUT ICON" href="media/icon.png"></link>
<meta name="description" content="Answer AMA Online Education questions at ease - BLND is an automated answering system developed for AMA Blended Learning users including Grade 11 and Grade 12 students.">
<meta name="keywords" content="AMA, OED, ONLINE, EDUCATION, SOURCE, GRADE 11, GRADE 12, SENIOR HIGH, BLENDED, LEARNING, AUTOMATED, ANSWERS">
<meta property="og:url" content="https://www.blnd.ga/"/>
<meta property="og:type" content="website"/>
<meta property="og:title" content="BLND - Blended Learning"/>
<meta property="og:description" content="Answer AMA Online Education questions at ease - BLND is an automated answering system developed for AMA Blended Learning users including Grade 11 and Grade 12 students."/>
<meta property="og:image" content="media/cover.jpg"/>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=UTF-8"/>
<meta name="VIEWPORT" content="width=device-width, initial-scale=1"/>
</head>
<body>
<!-- BACKGROUND / BODY -->
<div id="background-cut"></div>
<div id="overall-page">
<div>
<!--
BODY
-->
<div id="body">
<div id="body-wrapper" class="relative">
<div id="text" class="center no-line-height" style="margin:1%">
<div style="padding:2%">
<a href="index.php" id="blnd">
<p class="extra-large-text condensed line-height-fix bold" style="line-height:0">BLND</p>
<p class="normal-text large-spacing condensed line-height-fix" style="margin-top:-4%">API | BETA</p>
</a><br/>
<p class="large-text condensed bold" style="margin-top:50px;margin-top:5vh">REQUEST API KEY</p>
<div id="form" class="center">
<form method="POST" name="auto-answer" autocomplete="off" style="margin-top:3%">
<?php session_start();if(isset($_SESSION["key"])) {echo('<div id="key" class="inline condensed" style="margin:1%;line-height:1">'.$_SESSION["key"].'</div>');}?>
<input type="submit" id="generate" name="key-generate" onClick="<?php if(isset($_COOKIE['generated'])){echo 'return false';}?>" value="GENERATE"></input>
<br/>
</form>
</div>
</div>
</div>
<div style="margin:auto 10%;padding-bottom:5%">
<div style="font-family:arial;font-size:80%;color:black;padding:5%;background-color:rgba(255,255,255,1);width:inherit;" class="relative" id="code">
<div style="line-height:0"><span class="slightly-large condensed">USING THE API</span><p class="bold larger-than-normal condensed">COPY CODES BELOW | USE IT ON A .PHP FILE</p></div><br/>
<pre><comment><!-- COPY THIS CODE AND CHANGE THE VARIABLES ACCORDING TO YOUR WEBSITE --></comment>
<br/><form action="https://api.blnd.ga/">
<br/>	<?php
<br/><br/>	$website_url = ""; 	<comment>// URL OF THIS WEBSITE, SPECIFICALLY THIS PAGE</comment>
<br/>	$api_key = ""; 	<comment>// REQUEST THROUGH API.PHP PAGE</comment>
<br/>	$multiple_answers = ""; <comment>// IF YOU WANT THE API TO RETURN MULTIPLE RESULTS, SET TRUE</comment>
<br/>
<br/><br/><comment>// DO NOT TOUCH THE LINES BELOW. IT IS FOR YOUR SERVER TO INTERPRET THE DATA</comment>
<br/>	$api_key = base64_encode($api_key);$website_url = base64_encode($website_url); echo '<input name="data"value="' . "$api_key" . '+' . "$website_url" . '"type="hidden"/>';
if (isset($_GET['blndd_api_response'])) {$answer = base64_decode($_GET['blndd_api_response']);if (!empty($_GET['blndd_api_response_subject'])) {$subject = ' | Subject:' . base64_decode($_GET['blndd_api_response_subject']);} else {$subject = '';};} else {$answer = '';$subject = '';}if ($multiple_answers == 'true') {if (isset($_GET['multiple-answers'])) {$multiple = base64_decode(strtr($_GET['multiple-answers'], '-_,', '+/='));$process = explode('|', $multiple);$multiple_ans =str_replace('{','<br/>Q: ', $process);$multiple_ans = str_replace(['+'], '<br/>', $multiple_ans);$multiple_ans =str_replace('}', '<br/>Answer: ', $multiple_ans);}}if (empty($multiple_ans)) {$multiple_ans = '';}?>
<br/><br/><br/><comment><!-- YOU CAN CUSTOMIZE THE ELEMENTS BELOW | ACCESS THE DATA BY VARIABLES SUCH AS $answer AND $subject. USE THE FOREACH LOOP FOR PRINTING MULTIPLE RESULTS--></comment>
<br/>	<input name="question"></input><input type="submit" id="submit" value="ANSWER"></input></form><br/><br/>	<div><?php echo$answer.$subject?></div><br/>	<?php foreach((array)$multiple_ans as$multiple){echo$multiple;}?>
</pre>
<br/>
<p class="slightly-large condensed bold"><a href="https://api.blnd.ga/sample.php">CLICK: RENDERED OUTPUT</a></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>