-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller.php
More file actions
135 lines (130 loc) · 4.1 KB
/
controller.php
File metadata and controls
135 lines (130 loc) · 4.1 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?php
/*
Thread lanciati dall'utente, multiple richieste per lanciare multipli wrapper.
*/
include "simple_html_dom.php";
/*header("Qualcosa" . ' 500 Internal Server Error', true, 500);
return;*/
if(!isset($_GET["source"])){
header("Source not set", true, 400);
exit;
}
$toReturn = array();
switch($_GET["source"]){
case "steam":
if(!isset($_GET["game"])){
header("Game not set", true, 400);
exit;
}
$game = $_GET["game"];
require "wrappers/wrapper_steam.php";
break;
case "steamcharts":
if(isset($_GET['steam_appid']) && $_GET['steam_appid'] != ""){
$steam_appId = $_GET['steam_appid'];
// Steamcharts
include "wrappers/wrapper_steamcharts.php";
}else{
// no steam_appId
header("Game not set", true, 400);
exit;
}
break;
case "twitch":
if(!isset($_GET["game"])){
header("Game not set", true, 400);
exit;
}
$steam_game_name = $_GET["game"];
// Twitch
include "wrappers/wrapper_twitch.php";
break;
case "youtube":
if(!isset($_GET["game"])){
header("Game not set", true, 400);
exit;
}
$steam_game_name = $_GET["game"];
// Youtube
include "wrappers/wrapper_youtube.php";
break;
case "greenman":
if(!isset($_GET["game"])){
header("Game not set", true, 400);
exit;
}
$steam_game_name = $_GET["game"];
// GreenMan Gaming
include "wrappers/wrapper_greenman.php";
break;
case "g2a":
if(!isset($_GET["game"])){
header("Game not set", true, 400);
exit;
}
$steam_game_name = $_GET["game"];
// G2A
include "wrappers/wrapper_g2a.php";
break;
case "kinguin":
if(!isset($_GET["game"])){
header("Game not set", true, 400);
exit;
}
$steam_game_name = $_GET["game"];
// Kinguin
include "wrappers/wrapper_kinguin.php";
break;
case "g2play":
if(!isset($_GET["game"])){
header("Game not set", true, 400);
exit;
}
$steam_game_name = $_GET["game"];
// G2Play
include "wrappers/wrapper_g2play.php";
break;
case "sysreq":
if(!isset($_GET["game"])){
header("Game not set", true, 400);
exit;
}
$steam_game_name = $_GET["game"];
// Game System Requirements
include "wrappers/wrapper_gamesystemrequirements.php";
break;
case "topf":
// Twitch top 5
include "wrappers/wrapper_twitch_topgames.php";
break;
case "searchbytags":
if(!isset($_GET["tags"])){
header("Tags not set", true, 400);
exit;
}
// Steam Seach by TAGS
include "wrappers/wrapper_steam_searchbytag.php";
break;
case "searchbyname":
if(!isset($_GET["game"])){
header("Game not set", true, 400);
exit;
}
$game = $_GET["game"];
// Steam Search by NAME
include "wrappers/wrapper_steam_searchOnName.php";
break;
case "checksteam":
if(!isset($_GET["twitchGame"])){
header("Game not set", true, 400);
exit;
}
$twitchGame = $_GET["twitchGame"];
// Steam check game avaibility
include "wrappers/wrapper_steam_checkgameavaibility.php";
break;
}
header("Tappost", true, 200);
echo json_encode($toReturn);
return;
?>