· 6 years ago · Oct 31, 2019, 12:00 AM
1<?php
2include("SteamID.php");
3
4$APIKEY = "0EBBACAEBC6039B06DF1066807D55D4C";
5$WHO = $_GET["id"];
6$str = substr($WHO, 0, 4);
7
8$cacheFile = "/cache/users/controller.php?id=$WHO";
9$cachetime = 60;
10
11if (file_exists($cacheFile) && time() - $cacheFile < filemtime($cacheFile)) {
12 readfile($cacheFile);
13 } else {
14 GetApiInfo($WHO);
15
16 }
17function GetApiInfo($WHO) {
18 $s = SteamID::SetFromURL( $WHO, function( $URL, $Type ) use ( $APIKEY )
19 {
20 $Parameters =
21 [
22 'format' => 'json',
23 'key' => $APIKEY,
24 'vanityurl' => $URL,
25 'url_type' => $Type
26 ];
27
28 $c = curl_init( );
29
30 curl_setopt_array( $c, [
31 CURLOPT_USERAGENT => 'Steam Vanity URL Lookup',
32 CURLOPT_ENCODING => 'gzip',
33 CURLOPT_RETURNTRANSFER => true,
34 CURLOPT_URL => 'https://api.steampowered.com/ISteamUser/ResolveVanityURL/v1/?' . http_build_query( $Parameters ),
35 CURLOPT_CONNECTTIMEOUT => 5,
36 CURLOPT_TIMEOUT => 5
37 ] );
38
39 $Response = curl_exec( $c );
40
41 curl_close( $c );
42
43 $Response = json_decode( $Response, true );
44
45 if( isset( $Response[ 'response' ][ 'success' ] ) )
46 {
47 switch( (int)$Response[ 'response' ][ 'success' ] )
48 {
49 case 1: return $Response[ 'response' ][ 'steamid' ];
50 case 42: header("Location: steamerror.php");
51
52 }
53 }
54 throw new Exception( 'Failed to perform API request' );
55
56 } );
57$id3 = $s->RenderSteam3() . PHP_EOL;
58$idn = $s->RenderSteam2() . PHP_EOL;
59$id64 = $s->ConvertToUInt64() . PHP_EOL;
60$json = file_get_contents("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=".$APIKEY."&steamids=$id64");
61$apidata = json_decode($json);
62$name = $apidata->response->players[0]->personaname;
63$img = $apidata->response->players[0]->avatarfull;
64if (isset($apidata->response->players[0]->realname) == false ){
65 $realname = "N/A";
66} else{
67 $realname = $apidata->response->players[0]->realname;
68}
69
70if (isset($apidata->response->players[0]->loccountrycode) == false ){
71 $country = "N/A";
72} else{
73 $country = $apidata->response->players[0]->loccountrycode;
74}
75$url = $apidata->response->players[0]->profileurl;
76if ($name == null || $img == null ){
77 header("Location: steamerror.php");
78}
79}
80?>
81
82<!DOCTYPE html>
83<html>
84 <head>
85<!-- Site created: 9/19/19
86 Author: DriedSponge(Jordan Tucker) -->
87
88 <?php
89 include("meta.php");
90 ?>
91 <meta name="twitter:card" content="summary_large_image" />
92 <meta name="description" content="Name: <?php echo $name; ?>,SteamID64: <?php echo $id64; ?>, SteamID: <?php echo $idn; ?>, SteamID3: <?php echo $id3; ?>, URL: <?php echo $url; ?>" />
93 <meta name="keywords" content="<?php echo $name; ?>, <?php echo $id64; ?>, <?php echo $idn; ?>, <?php echo $id3; ?>" />
94 <meta property="og:site_name" content="DriedSponge.net | SteamID Finder" /> <!-- Replace with your name or whatever you want-->
95 <meta property="og:title" content="Info on <?php echo $name; ?>" />
96 <meta property="og:image" content="<?php echo $img;?>" />
97 <meta property="og:image:type" content="image/png" />
98 <meta name="author" content="Jordan Tucker">
99 <meta property="og:description" content="SteamID64: <?php echo $id64; ?> SteamID: <?php echo $idn; ?> SteamID3: <?php echo $id3; ?> URL: <?php echo $url; ?>" />
100 <meta property="og:site_name" content="<?php echo $name; ?> - driedsponge.net" />
101 <title><?php echo $name; ?> - driedsponge.net</title>
102
103 <script src="https://kit.fontawesome.com/0add82e87e.js" crossorigin="anonymous"></script>
104
105 <link rel="stylesheet" href = "//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css" type="text/css" >
106
107 <style>
108 .url{
109 color: white;
110 text-decoration: underline;
111 }
112 .url:hover{
113 color: rgb(228, 228, 228);
114 text-decoration: underline;
115 }
116
117 </style>
118 </head>
119
120 <body>
121
122 <div class="app">
123 <div class="container-fluid-lg">
124 <div class="page-header">
125
126 <nav class="navbar navbar-expand-lg navbar-dark nbth fixed-top" >
127 <a class="navbar-brand" href="#"><strong>driedsponge.net</strong></a>
128 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarmain" aria-controls="navbarmain" aria-expanded="false" aria-label="Toggle navigation">
129 <span class="navbar-toggler-icon"></span>
130 </button>
131 <div class="collapse navbar-collapse" id="navbarmain">
132
133 <ul class="navbar-nav mr-auto mt-2 mt-lg-0">
134 <li class="nav-item"><a class="nav-link" href="index.php">Home</a></li>
135 <li class="nav-item"><a class="nav-link" href="webdesign.php">Web Projects</a></li>
136 <li class="nav-item"><a class="nav-link" href="lua.php">Lua Projects</a></li>
137 <li class="nav-item"><a class="nav-link" href="tutorials/index.php">Coding Tutorials</a></li>
138 <li class="nav-item active"><a class="nav-link" href="steam.php">Steam Tool<span class="sr-only">(current)</span></a></li>
139 </ul>
140 </div>
141 </nav>
142
143
144 </div>
145
146 </div>
147 <div class="container-fluid-lg" style="padding-top: 80px;">
148
149
150
151 <div class="container">
152
153 <hgroup>
154 <h2><strong>Steam ID Tool</strong></h2>
155 <br>
156
157 <?php
158 include("search.php");
159 ?>
160
161 <br>
162 </hgroup>
163 <div class="jumbotron" style="text-align: center;">
164 <h2><img src="<?php echo $img; ?>"/></h2>
165 <h1>Results for: <?php echo $name; ?></h1>
166 <p class="paragraph"><strong>SteamID64:</strong> <?php echo $id64; ?> <button value="<?php echo $id64; ?>" onclick="copything(this.value)" class="btn btn-success"><i class="far fa-copy"></i></button></p>
167 <p class="paragraph"><strong>SteamID:</strong> <?php echo $idn; ?> <button value="<?php echo $idn; ?>" onclick="copything(this.value)" class="btn btn-success"><i class="far fa-copy"></i></button></p>
168 <p class="paragraph"><strong>SteamID3:</strong> <?php echo $id3; ?> <button value="<?php echo $id3; ?>" onclick="copything(this.value)" class="btn btn-success"><i class="far fa-copy"></i></button></p>
169 <p class="paragraph"><strong>Profile URL:</strong> <a class="url" target="_blank" href="<?php echo $url; ?>"><?php echo $url; ?></a> <button value="<?php echo $url; ?>" onclick="copything(this.value)" class="btn btn-success"><i class="far fa-copy"></i></button></p>
170 <h4 class="subheading" style="color: white;">Personal Info (This may not be accurate)</h4><br>
171 <p class="paragraph"><strong>Real Name:</strong> <?php echo $realname; ?> <button value="<?php echo $realname; ?>" onclick="copything(this.value)" class="btn btn-success"><i class="far fa-copy"></i></button></p>
172 <p class="paragraph"><strong>Country</strong>: <?php echo $country; ?> <button value="<?php echo $country; ?>" onclick="copything(this.value)" class="btn btn-success"><i class="far fa-copy"></i></button> </p>
173
174 </div>
175
176
177
178
179
180
181
182
183 </div>
184</div>
185</div>
186<!-- End of "app" -->
187
188<?php
189include("hex.php");
190 include("footer.php"); // we include footer.php here. you can use .html extension, too.
191 ?>
192
193
194
195
196
197 <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
198 <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
199 <script src="https://unpkg.com/popper.js@1"></script>
200 <script src="https://unpkg.com/tippy.js@4"></script>
201 <script src="main.js"></script>
202
203
204 <script src="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
205 <script>
206 document.getElementById("id64").value = "<?php echo $WHO;?>";
207
208 </script>
209 <script>
210 function copything(value){
211
212
213 navigator.clipboard.writeText(value)
214
215 toastr["success"](value + " was successfully copied to clipboard", "Congradulations!")
216
217 toastr.options = {
218 "closeButton": true,
219 "debug": false,
220 "newestOnTop": false,
221 "progressBar": true,
222 "positionClass": "toast-top-right",
223 "preventDuplicates": true,
224 "onclick": null,
225 "showDuration": "300",
226 "hideDuration": "1000",
227 "timeOut": "5000",
228 "extendedTimeOut": "1000",
229 "showEasing": "swing",
230 "hideEasing": "linear",
231 "showMethod": "fadeIn",
232 "hideMethod": "fadeOut"
233 }
234 }
235
236
237 </script>
238 <script src="search.js"></script>
239 </body>
240
241
242
243
244
245
246</html>