generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How to create your own web APIs?

Previous Thread :: Next Thread 
EgoMoose is not online. 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 is not online. EgoMoose
Joined: 04 Feb 2009
Total Posts: 2896
05 Dec 2014 10:45 AM
Bump.
Report Abuse
Fedorakid is not online. 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
DerProgrammierer is not online. DerProgrammierer
Joined: 16 Aug 2007
Total Posts: 12992
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
SethDusek5 is not online. SethDusek5
Joined: 26 Mar 2011
Total Posts: 2580
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
DerProgrammierer is not online. DerProgrammierer
Joined: 16 Aug 2007
Total Posts: 12992
05 Dec 2014 11:35 AM
You can use JavaScript. You can use almost any language.
Report Abuse
Fedorakid is not online. 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
DerProgrammierer is not online. DerProgrammierer
Joined: 16 Aug 2007
Total Posts: 12992
05 Dec 2014 11:39 AM
Fedora, think of JavaScript as a LocalScript and PHP as a Script, here on Roblox.

Report Abuse
eLunate is not online. 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 is not online. 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 is not online. 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
DerProgrammierer is not online. DerProgrammierer
Joined: 16 Aug 2007
Total Posts: 12992
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
SethDusek5 is not online. SethDusek5
Joined: 26 Mar 2011
Total Posts: 2580
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 is not online. L0cky2013
Joined: 30 Jul 2012
Total Posts: 1446
05 Dec 2014 04:42 PM
DONT USE PHP
Report Abuse
Fedorakid is not online. 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 is not online. 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
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
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
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
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 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
05 Dec 2014 06:19 PM
Read "PHP a fractal of bad design".
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
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
SethDusek5 is not online. SethDusek5
Joined: 26 Mar 2011
Total Posts: 2580
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 is not online. 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
SethDusek5 is not online. SethDusek5
Joined: 26 Mar 2011
Total Posts: 2580
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 is not online. 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
DerProgrammierer is not online. DerProgrammierer
Joined: 16 Aug 2007
Total Posts: 12992
07 Dec 2014 11:50 AM


"Read "PHP a fractal of bad design"."


It's not like JavaScript is much better.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image