NSA
sudo apt-get thefuckout.tar.gz
- Dec 9, 2011
- 715
- 86
Hello, DevBest!
I've created a JSON API for hotel's that wish to allow users to use hotel data off-site.
With this, users will be able to create their own scripts using their player data.
They could create player cards etc...
Currently, the API let's users choose whether they want to be able to access their
data by using the API (for privacy reasons).
On line 247 in api.php, there is a parameter "false".
False means the API won't check the database to see if users don't wish to
change the API settings (not let them choose whether they want their data accessible via the API)
but just force the data to be visible.
If you wish to allow them to choose, change the parameter to true and run the included SQL
file into the database.
There isn't a way for them to change this on the site currently, so you'll
have to add something on the settings page(i.e. radio buttons or checkbox).
Currently, data users can access via the API is:-
Username
Motto
Credits
Online Status (0, 1)
Respect
Achievement
Room Visits
Gifts Given
Gifts Received
User Look
I have only tested this with Phoenix EMU.
If you need any help, send me a message or reply to this thread.
Thanks!
V4.0:
Example usage with PHP:
Example usage with JavaScript:
Screenies.
JSON
I've created a JSON API for hotel's that wish to allow users to use hotel data off-site.
With this, users will be able to create their own scripts using their player data.
They could create player cards etc...
Currently, the API let's users choose whether they want to be able to access their
data by using the API (for privacy reasons).
On line 247 in api.php, there is a parameter "false".
False means the API won't check the database to see if users don't wish to
change the API settings (not let them choose whether they want their data accessible via the API)
but just force the data to be visible.
If you wish to allow them to choose, change the parameter to true and run the included SQL
file into the database.
There isn't a way for them to change this on the site currently, so you'll
have to add something on the settings page(i.e. radio buttons or checkbox).
Currently, data users can access via the API is:-
Username
Motto
Credits
Online Status (0, 1)
Respect
Achievement
Room Visits
Gifts Given
Gifts Received
User Look
I have only tested this with Phoenix EMU.
If you need any help, send me a message or reply to this thread.
Thanks!
V4.0:
You must be registered for see links
Example usage with PHP:
PHP:
<?php
$request = "api.php?username=my_username";
$ci = curl_init($request);
curl_setopt($ci,CURLOPT_RETURNTRANSFER, TRUE);
$input = curl_exec($ci);
curl_close($ci);
$result = json_decode($input, true);
echo $result['user']['username'];
?>
Example usage with JavaScript:
Code:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
$.getJSON(
'api.php?username=my_username',
function(data) {console.log(data['user']['username'])}
);
</script>
Screenies.
JSON