-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
22 lines (21 loc) · 825 Bytes
/
index.php
File metadata and controls
22 lines (21 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
/* copyleft 2013 (CC-0) Melker "meklu" Narikka
* copyleft 2013 (CC-0) Josh "Cheeseness" Bush
*
* This is an example case for those using this parser.
* It prints the data as JSON and sets an appropriate heading for it as well
*/
/* We mustn't forget to include the parser */
require_once("steameventparser.php");
/* Setting the MIME type */
header("Content-Type: application/json");
/* Allowing CORS */
header("Access-Control-Allow-Origin: *");
/* Initialising the parser */
$parser = new SteamEventParser();
/* Generating and echoing the data */
$data = $parser->genData("steamlug");
echo json_encode($data);
/* The following was used to generate the example data in the README: */
# echo preg_replace("#(\h)+$#m", "", preg_replace("#^#m", " ", str_replace(" ", " ", var_export($data, true)))) . "\n";
?>