You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server
0
b/Web publicado por u/Ephraim Becker November 13, 2015, 08:01:23 PM
I already know HTML, CSS, and JavaScript. I'm trying to get my Virtual friend to talk about the latest stuff getting the data from the internet. Which programming language is the best for this and i'm already using JavaScript for my Virtual friend so I think JavaScript will have to connect to the server-side programming language to work.
Inicia sesión o crea una cuenta para dejar un comentario
u/Snektron November 13, 2015, 08:03:01 PM
Most servers use PHP for web side developement, but there is also Lua Server Pages and i believe you can also use python for it.
Also i think you can do it with JS too, with NodeJS but im not entirely sure about that.
u/novenary November 13, 2015, 08:50:52 PM
You can use pretty much anything for server-side stuff. JS on Node (which is a pretty good idea with websockets apparently), Python, C... Avoid PHP at all costs for real time code, it's definitely not made for that.
u/alexgt November 13, 2015, 10:11:36 PM
I would suggest PHP :)
u/Ephraim Becker November 14, 2015, 11:13:28 PM
Should I go with AJAX?
u/novenary November 14, 2015, 11:45:03 PM
AJAX is not a language, it's a communication model used by Javascript programmers. It doesn't solve the problem of what runs on the server side.
u/Ephraim Becker November 15, 2015, 12:12:08 AM
Is JavaScript with http requests going to work?
u/DarkestEx November 15, 2015, 12:22:31 AM
Quote from: Ephraim Becker on November 13, 2015, 08:01:23 PM
I already know HTML, CSS, and JavaScript. I'm trying to get my Virtual friend to talk about the latest stuff getting the data from the internet. Which programming language is the best for this and i'm already using JavaScript for my Virtual friend so I think JavaScript will have to connect to the server-side programming language to work.
PHP will certainly be the best one. Just send the data using the JSON encoding to the server and get the response.
You can just get stuff. This use case is not server event based so you can unproblematically use GET requests.
I don't see any issue with using PHP, really. Also its what you expect on a normal webhost.
Last Edit: November 15, 2015, 12:24:27 AM by DarkestEx
u/Ephraim Becker November 15, 2015, 12:26:40 AM
What i'm trying to do is access the RSS feeds from a website (example: cnet)
u/DarkestEx November 15, 2015, 12:27:15 AM
Quote from: Ephraim Becker on November 15, 2015, 12:26:40 AM
What i'm trying to do is access the RSS feeds from a website (example: cnet)
Yes then you should certainly go with PHP and get it using your Javascript application.
If you need any help you can ask me. I did such things pretty often before and I can help you make it output JSON that Javascript can easily read.
u/Ephraim Becker November 15, 2015, 12:31:10 AM
I learnt PHP on codecademy. How do I get it to use my JavaScript application?
u/DarkestEx November 15, 2015, 12:37:04 AM
Quote from: Ephraim Becker on November 15, 2015, 12:31:10 AM
I learnt PHP on codecademy. How do I get it to use my JavaScript application?
Well first you have a PHP application that retrieves the feed when called. It should output some JSON formatted array (just a simple associative array and use print(json_encode($my_array)) to send it).
Then you send a web request every time you need new data and download the json response and use JSON.parse(data_from_request) to get an array of your feed stuff.
After that you can just use the data.
u/Ephraim Becker November 15, 2015, 12:40:38 AM
What i'm trying to do is when I talk to the Virtual friend about technology news, I want it to fetch data from cnet RSS feed and turn it into a conversation about it. Is there any way to do this?
u/DarkestEx November 15, 2015, 12:47:10 AM
Quote from: Ephraim Becker on November 15, 2015, 12:40:38 AM
What i'm trying to do is when I talk to the Virtual friend about technology news, I want it to fetch data from cnet RSS feed and turn it into a conversation about it. Is there any way to do this?
Well about fetching, yes, but the other part of turning it into a conversation is hard and would be your part and business.

Edit: you could link it up to wolfram alpha and have a lot of facts and functions added.
Last Edit: November 15, 2015, 12:51:06 AM by DarkestEx
u/Ephraim Becker November 15, 2015, 12:59:03 AM
Should I turn my existing HTML into a PHP or should I create a separate PHP?
Start a Discussion

b/Web

Website developement and scripting

68
Topics
Explore Board
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal