I want to set up a website which can do this:
The page itself should be blank or just a connect button.
While on the website I want to connect to an IRC server and listen for a specific command, which is given by a simple IRC message.
When receiving this command I want to play a short sound file that the command arrived.
This have to run in the webbrowser and should work on a normal webserver.
I already found something about node.js but this sounds like everything runs on the server itself, but this is what I don't want to have.
How can I do this? I know that I need javascript but I don't now where I could start.
I'd prefer some light open source projects I can modify a bit so there isn't much to do for me.
Related
`My first acquaintance with JavaScript. I'm trying to create simple webpage using Live Server.
Unfortunately, a local server can just be opened manually, but I want it to be done from VS.
I looked through my tips in Live Server settings. They are seems to be put correctly.
Probably the problem is hidden in blocking outgoing from firewall?
If you have some ideas on what's wrong, I will be glad to hear your proposals.
I have created a JavaScript program that I want to have running 24/7 on an online server. How do I setup a server to make that happen? I am using infinityfree.com as my host for now. At the moment I have setup an HTML file that loads my javascript when a user connect to the webpage, but that is not the behavior that I want.
Ideally I would like to be able to use this infinityfree server to host a very simple website, and have it also constantly running my Javascript code, whever a user is accessing the site or not. Any advice would be greatly appreciated.
I will be online to answer all questions or comments instantly for the next 30 minutes.
Use NodeJs : https://nodejs.org/
You can easly run js scripts with it.
My advice is to use docker to run and deploy a node server in just 2 minutes of time. After adapt you're script to never end. At the end, you Just need to find a cloudhoster.
So, I'm pretty new to Django, python, and javascript.
I have a partially functional Django webserver that, while developing it, I host locally on my machine.
I've made a button with HTML which I've figured out can be tied to a javascript script. The next step for me was to make this button "execute" a python script that's sitting on my machine, particularly on the /desktop directory. I can of course move the script though, but the important part is that I want that python script (let's call it django_test_script.py) to open its own window on my machine. It's just a file that says "hi" in stdout, then closes after 5 seconds, but due to the plan for this whole project, I want that to happen. I want to have my website open on my machine, click that button, then have the script's console pop up on my desktop and run/finish.
The eventual goal is to control an LED strip that's plugged into my raspberry pi. I want colored buttons on the website that, when clicked, run appropriate python scripts that turn the lights to that color. It wouldn't take me long to write up the python scripts themselves that would change colors, but I need to bridge the gap between "button causes a py script to run" and the python script actually running.
I see a ton of questions similar to this, but they all seem to involve running the python scripts WITHIN the webserver, like internal files that do everything and then return something to the server via an HttpResponse.
I don't need an HttpResponse. Literally all I want to do for right now is figure out how to make a script that's stored on the machine run.
I've done some reading on AJAX and I'm guessing that's involved, however everything I've tried has failed with AJAX in terms of actually getting the server to RUN a script. I've been scouring the internet for over an hour now and have found basically nothing useful (as far as I can tell) so I figured I may as well ask for help. Can someone please point me in the right direction in terms of what I'll need to do?
I'm afraid that's not possible. The browser doesn't allow to execute local scripts since everything is (for security reasons) in a sandbox.
If you want to execute something you could do one of the following:
Use a http server which executes the script and call it via AJAX
You build it into an exectron / nodejs app which opens more possibilities to access the system. See this example
But from your requirement I assume the website will be opened on another device to remote control the Pi led? If you you'll need to use some sort of http server as otherwise you can't run the script on the pi itself.
newbie here.
So I have this button, when a user click on that button, a node.js fs function will execute and will create a new folder for me, that is the fs.mkdir() function,
the code is just simple, and works on the terminal too, but I do not want to work in the terminal anymore I want to test on browser, I want to bind html elements to nodejs, I am so confused right now, when I open my html file it gives me an error : "require is not define", I search and search for hours. and I realize that most of the tutorials online they test and run the code in the terminal so how does someone test on browser to know if their code works?
to summarize my problem, I just want to interact on html elements, and that elements will cause to fire a node.js functions, how do I test it in the browser?
Node.js is used to run javascript on a node server. It runs server-side
The browser plays the role of a client
If you want to click a button in the browser and then execute a function in nodejs as a result of the click, you need to know that the architecture is a client-server
You'll need to setup a nodejs server, maybe using express.js, and then you'll need to do maybe a form in html that sends an http query from the browser to the server, so that the server executes the script you want.
I am looking for a way to make the client machine execute some command line in the command prompt (cmd) from a web page (intranet application).
I guess (and hope) this cannot be done by browser standards. But assuming I have full access to the clients' machines and can setup everything I need on them - Is there a way to make Internet Explorer trigger a launch of cmd and execute a given command? So I could then include hyperlinks or javascript to access it like, for example, this:
Click Me
executeCmd('C:\\Program Files\\...');
If there is no easy way to configure something like this, I'd be very thankful for workarounds or different approaches to trigger a command from a web page.
Instead of using
Click Me
executeCmd('C:\\Program Files\\...');
Use this
Click Me