jak12321
|
  |
| Joined: 12 Dec 2007 |
| Total Posts: 2814 |
|
|
| 19 Aug 2012 06:53 PM |
Hi.
I've been working on something pretty cool for PHP, which is API for the ROBLOX website. It allows you to get the statistics of any item, user, forum or thread and work with it in PHP.
It's real simple if you know the PHP language, but I was wondering if anyone would actually used it if I was to release all the sourcecode?
An example of basic user details are as followed:
include './api.php'; $robloapi = new RobloxApi();
$robloapi->EnableDebug(); $robloapi->SetKey("_dev");
$user_object = $robloapi->userContent("jak12321"); // Or userContent(12345); accepts userIDs and usernames $user_details = $robloapi->userDetails($user_object);
if ($user_details["status"] == "active") { // roblox forums wont allow html tags print("Username: " . $user_details["username"] . "(br)(br)"); print("Description: " . $user_details["description"] . "(br)(br)"); print("Activity Status: " . $user_details["onlinestatus"] . "(br)(br)"); print("Friend Count: " . $robloapi->demolishComma($user_details["friendcount"]) . "(br)(br)"); print("Forum Posts: " . $robloapi->demolishComma($user_details["forumposts"]) . "(br)(br)"); print("Profile Views: " . $robloapi->demolishComma($user_details["profileviews"]) . "(br)(br)"); print("Place Visits: " . $robloapi->demolishComma($user_details["placevisits"]) . "(br)(br)"); print("Knockouts: " . $robloapi->demolishComma($user_details["knockouts"]) . "(br)(br)"); print("Avatar: (br)(br)(img src=\"" . $user_details["avatar"] . "\")>(br)(br)"); // again cant use proper html tags in this :( } else { print("User is " . $user_details["status"]); // "banned", "invalid" }
There's going to be some limits and batch requests to cut down on many requests at once against ROBLOX's servers.
Any suggestions on what to add other than what I've got? Thanks. |
|
|
| Report Abuse |
|
|
|
| 19 Aug 2012 07:14 PM |
| I bet someone will find a use for it (I personally won't, but I can assure you someone will) |
|
|
| Report Abuse |
|
|
Seranok
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 19 Aug 2012 07:41 PM |
| What'd be a lot more useful than something like this, which is just a simple parsing of a web page to get certain details, would be a database which would contain this kind of information, so you could do queries against it. (obviously not owned by RBLX) |
|
|
| Report Abuse |
|
|
jak12321
|
  |
| Joined: 12 Dec 2007 |
| Total Posts: 2814 |
|
|
| 19 Aug 2012 07:56 PM |
Like a single website to get this data? Eg. /api?action=userdetails&user=jak12321 /api?action=forumdetails&thread=1000
|
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 19 Aug 2012 08:23 PM |
| When do you plan on releasing it? I can use this. :D |
|
|
| Report Abuse |
|
|
jak12321
|
  |
| Joined: 12 Dec 2007 |
| Total Posts: 2814 |
|
|
| 19 Aug 2012 08:51 PM |
| Hopefully in Tuesday/Wednesday. I'll hopefully post on here when it's at a point where I can release some of it. |
|
|
| Report Abuse |
|
|
coolbob44
|
  |
| Joined: 26 Nov 2009 |
| Total Posts: 1649 |
|
|
| 19 Aug 2012 09:35 PM |
| I might be able to use this for some new features on the LuaLearners website. If possible, could you PM me when you have released it? |
|
|
| Report Abuse |
|
|
jak12321
|
  |
| Joined: 12 Dec 2007 |
| Total Posts: 2814 |
|
| |
|
NXTBoy
|
  |
| Joined: 25 Aug 2008 |
| Total Posts: 4533 |
|
|
| 20 Aug 2012 04:22 AM |
| Can you open source this on github? |
|
|
| Report Abuse |
|
|
jak12321
|
  |
| Joined: 12 Dec 2007 |
| Total Posts: 2814 |
|
|
| 20 Aug 2012 11:12 AM |
I'll get it on github at some point, but I'm unable to post outside links on the forums. So I'll probably keep an updated version as a ROBLOX script/model and post it on here when it's updated.
|
|
|
| Report Abuse |
|
|
|
| 20 Aug 2012 11:14 AM |
| Sounds like a fine script but there is a couple bugs I see in it |
|
|
| Report Abuse |
|
|
jak12321
|
  |
| Joined: 12 Dec 2007 |
| Total Posts: 2814 |
|
|
| 20 Aug 2012 11:22 AM |
@benpreston123 - That runs perfect on my copy, I don't see any issues other than the API not being there or the HTML tags having to be curly brackets for the ROBLOX forums.
What exactly are the problems you see? |
|
|
| Report Abuse |
|
|
L3GabeL4
|
  |
| Joined: 18 Feb 2012 |
| Total Posts: 808 |
|
|
| 20 Aug 2012 11:32 AM |
i think this is an amazing idea, and if you dont mind i'd like to do something similar. This sounds like something fun to develop.
side-question: why're using print()? |
|
|
| Report Abuse |
|
|
jak12321
|
  |
| Joined: 12 Dec 2007 |
| Total Posts: 2814 |
|
|
| 20 Aug 2012 11:36 AM |
@L3Gabel4 - It's only for debug purposes, this is only code for showing how to retrieve data. Also there's a handy function that's similar to print called print_r which prints whole arrays.
Instead of switching between echo, I just stuck to print related functions for this. |
|
|
| Report Abuse |
|
|
Merely
|
  |
| Joined: 07 Dec 2010 |
| Total Posts: 17266 |
|
|
| 20 Aug 2012 11:36 AM |
| Tthis would make a WHOLE lot more since in a programming language like C# or Java. All this API appears to do is send a GET request to the user's profile and grab a few strings from the page. |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2012 11:40 AM |
@Merely
All you need is a sockets API. Just sent a GET query using the HTTP protocol and parse the results.
Then again, you could just make the program look up the catalog page and parse it itself, but then it would only work in that particular language. |
|
|
| Report Abuse |
|
|
slayer219
|
  |
| Joined: 15 Nov 2008 |
| Total Posts: 3445 |
|
|
| 20 Aug 2012 11:41 AM |
| @Merely: WEB Api. umad? Stick some CSS in there and you'll be good to go. |
|
|
| Report Abuse |
|
|
Merely
|
  |
| Joined: 07 Dec 2010 |
| Total Posts: 17266 |
|
|
| 20 Aug 2012 11:43 AM |
| What I mean is: in the 1% case where having this sort of thing in PHP would be a good thing, you could write the parsing code yourself in a couple of minutes. I don't see that this "API" is very useful. |
|
|
| Report Abuse |
|
|
jak12321
|
  |
| Joined: 12 Dec 2007 |
| Total Posts: 2814 |
|
|
| 20 Aug 2012 11:52 AM |
@Merely - This thing handles exceptions, issues with parsing, understanding if an item is not on sale without trying to return the entire document as 0(false), 0 is returned.
This is intended for web applications that was to utilize ROBLOX's data for their own projects. Writing it in C# for a web project is out of the picture. |
|
|
| Report Abuse |
|
|
Merely
|
  |
| Joined: 07 Dec 2010 |
| Total Posts: 17266 |
|
|
| 20 Aug 2012 11:54 AM |
| Well I guess if someone is making a Web app and doesn't know how to code this would be a handy library for them... |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2012 11:58 AM |
"making a Web app" "doesn't know how to code"
wat
Anyways, if you ever find yourself in a situation where you can use an API, use it by all means just because it is easier to work with. |
|
|
| Report Abuse |
|
|
L3GabeL4
|
  |
| Joined: 18 Feb 2012 |
| Total Posts: 808 |
|
|
| 20 Aug 2012 11:58 AM |
"@L3Gabel4 - It's only for debug purposes, this is only code for showing how to retrieve data. Also there's a handy function that's similar to print called print_r which prints whole arrays.
Instead of switching between echo, I just stuck to print related functions for this."
oh, i see.
"Also there's a handy function that's similar to print called print_r which prints whole arrays. " "called print_r" "print_r"
woow!! thanks! i dont know of any book that teaches this. is it even on the php net? |
|
|
| Report Abuse |
|
|
jak12321
|
  |
| Joined: 12 Dec 2007 |
| Total Posts: 2814 |
|
|
| 20 Aug 2012 12:01 PM |
@L3Gabel4 - It's in the PHP documentation, took me months to find it but it's in there :-)
I think I found it on a StackOverflow question after I was parsing JSON in a project once. |
|
|
| Report Abuse |
|
|
|
| 20 Aug 2012 12:27 PM |
| I've been developing websites for about 2 years now, and I am just now starting to get into advanced PHP. I say bravo sir, though I don't think this will be of much use to the move advanced coders. |
|
|
| Report Abuse |
|
|
| |
|