EgoMoose
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 2896 |
|
|
| 04 Dec 2014 10:16 PM |
So I've been wondering for quite awhile what the steps are for making a user-created web API. I'm curious to learn as I have some ideas that could only be achieved through use of the http service. The problem is I've never written a web API before, let alone one specific to Roblox.
Are there any videos or websites that could guide me in the right direction? Once I understand the basics I'm sure I'll be able to pick it up quick. |
|
|
| Report Abuse |
|
|
EgoMoose
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 2896 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 05 Dec 2014 11:10 AM |
I'm doing the same,
I knew what I had to do to accomplish this which is the following
PHP/maybe javascript knowledge A webhost to use the above. So that you can use HttpService with the domain. |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 11:22 AM |
There's nothing different from an API and any other program, except that the API gives access to your program/library so others can use it without changing your code.
|
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 11:26 AM |
You need to know Php or any other serverside programming language. ( not sure if node.js or ruby will work, never tried)
You cant use JavaScript since JavaScript is run on the client's machine. ROBLOX would need to have JavaScript code to actually run it.
I've used PHP and done some cool stuff with it.
If you want to send arrays, use the json_encode function in php and then when you get the array, json decode it.
|
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 11:35 AM |
| You can use JavaScript. You can use almost any language. |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 05 Dec 2014 11:38 AM |
@Seth, I don't really get what javascript does lol.
Like all I know about it is that it can make dynamic webpages, and I'm like "Isn't that what we have PHP for? What?" |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 11:39 AM |
Fedora, think of JavaScript as a LocalScript and PHP as a Script, here on Roblox.
|
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 05 Dec 2014 11:40 AM |
| Ruby, perl, python, PHP and node.js will all be fine for it |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 05 Dec 2014 11:42 AM |
| Oh.....what uses does javascript have compared to PHP? like I mean, the advantage javascript has over PHP? |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 05 Dec 2014 11:45 AM |
PHP = Server behaviour JS = Webpage behaviour and interactivity (Handled by the browser) |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 11:50 AM |
Nothing really, but unlike PHP, you generally execute it on the client (Node.js is different).
You want to use PHP for things you can't trust the client with, because someone could change code and send you false data. JavaScript is only ran on the client. For example, say you're making a calculator, it doesn't make sense to do in PHP, because you'll be sending data to server and back every time, where as JavaScript will do it solely on your computer. |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 04:17 PM |
First, javascript cant be used. It's run on the client's machine and roblox doesnt have support for javascript.
@fedora JavaScript is usually used to make the webpage more fancy by doing clientside stuff while PHP is used for retrieving data, etc.
I think you can run php functions in JavaScript using AJAX, havent tried it yet. |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
| |
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 05 Dec 2014 04:43 PM |
^ really bro
really
dude i want some pizza right now
but on the other hand
im so tired
-_- |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 05 Dec 2014 06:04 PM |
1) Don't use PHP 2) You can run Javascript on the server
I recommend Python.
@Seth: "I think you can run php functions in JavaScript using AJAX, havent tried it yet." AJAX basically sends out a HTTP request to a server without reloading the page or blocking the UI. What you described there is what AJAX is for. |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:11 PM |
Wikimedia started using a new PHP runtime and reduced the average cpu load from 50% to 16%
i dont know why people hate on php for no reason |
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:19 PM |
Also, here's some benchmarks from PHPNG (PHP next generation) which will be used as a base for the next major release
bench.php (sec) - time taken to execute Zend/bench.php bench.php (instr) - number of CPU instructions retired during Zend/bench.php execution WordPress (sec) - time taken to perform 1000 requests to wordpress-3.6.0 home page WordPress (instr) - number of CPU instructions retired during 100 requests to wordpress-3.6.0 home page
01/20/2014 bench.php (sec) - 2.115 bench.php (instr) - 11,066,515,044 WordPress (sec) - 26.756 WordPress (instr) - 9,413,106,833
11/21/2014 bench.php (sec) - 1.201 bench.php (instr) - 7,171,414,831 WordPress (sec) - 13.430 WordPress (instr) - 3,138,706,949 |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 05 Dec 2014 06:19 PM |
Read "PHP a fractal of bad design".
|
|
|
| Report Abuse |
|
|
|
| 05 Dec 2014 06:34 PM |
What he said is true, but PHP is easier to set up which is why I still use it
PHP 7 will also contain an improved variable syntax which is internally consistent and complete, resolving a long-standing issue in PHP. This will allow use of ->, [], (), {}, and :: operators with arbitrary meaningful left-hand-side expressions. |
|
|
| Report Abuse |
|
|
|
| 06 Dec 2014 02:59 AM |
@Droid
node.js is a lot different. Also a lot of free webhosts dont have support for node.js or Python. including 000webhost.
Ruby is probably the slowest for this job though. A person on IRC said
'I used Ruby once, It's the slowest thing I've ever used.' |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 06 Dec 2014 03:42 AM |
| I swear by Ruby for scalable response stuff. Dynamic responses? Couldn't say I'd trust it quite so much. |
|
|
| Report Abuse |
|
|
|
| 06 Dec 2014 04:19 AM |
ruby has some pretty neat stuff such as installing gems (frameworks) easily
by doing gem install gemname |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 06 Dec 2014 06:32 AM |
gem install bundler gem install mysql2
Done. Never have to worry about anything ever again. |
|
|
| Report Abuse |
|
|
|
| 07 Dec 2014 11:50 AM |
"Read "PHP a fractal of bad design"."
It's not like JavaScript is much better. |
|
|
| Report Abuse |
|
|