Overclock.net - An Overclocking Community

Overclock.net - An Overclocking Community (https://www.overclock.net/forum/)
-   Coding and Programming (https://www.overclock.net/forum/142-coding-programming/)
-   -   Need to run URL without opening browser (https://www.overclock.net/forum/142-coding-programming/1642079-need-run-url-without-opening-browser.html)

dseg 11-15-2017 07:12 AM

I am not a coder in anyway.
But I need a URL to run in the background for my security cameras.
When you enter the URL, it executes a function on the camera but I need to to happen every 5 minutes.

I was able to make a batch file but it would open a browser.
Do I need to download some kind of software program to execute a code like this?

mott555 11-15-2017 07:20 AM

Can you use wget? I assume there's a Windows version via Cygwin or something.

dseg 11-15-2017 08:27 AM

Quote:
Originally Posted by mott555 View Post

Can you use wget? I assume there's a Windows version via Cygwin or something.

I found that suggestion too:
https://superuser.com/questions/873561/call-url-from-console-without-opening-in-any-browser

Do you know what my full code would be?

mott555 11-15-2017 08:47 AM

I'm not sure. On Linux it would be
Code:
wget yourUrlHere > /dev/null 2>&1

which would contact that URL and ignore the HTML that comes back (wget normally downloads the results and saves them to a local file). If you use Cygwin on Windows it ought to be pretty similar.

jakethesnake438 11-15-2017 12:37 PM

do you need to do anything with the result from the server?

dseg 11-15-2017 02:11 PM

Quote:
Originally Posted by jakethesnake438 View Post

do you need to do anything with the result from the server?

No, executing the URL runs a function on the camera. I would just need it to run with zero output.

Zer0CoolX 11-15-2017 02:15 PM

Have you spoken to the manufacturer of the camera to see what your options are? Maybe they have a tool to accomplish this already or another way to trigger the function.

Also it may help if we knew the make/model of the cameras and the function you are trying to trigger.

On windows I think its possible to open a url in a browser and at least keep it minimized. You could then create a scheduled task to fire it off at whatever interval you like.

Once triggered, does the function require that the url/browser stay open to complete?

EDIT: to clarify are you on Windows or Linux from which you need to do this?

Tjj226 Angel 11-22-2017 11:51 PM

Could you run the browser in headless mode?

gonX 11-23-2017 04:52 PM

Use cURL:
https://curl.haxx.se/download.html

The command is really easy "curl <address>"

Use Windows' own Task Scheduler to run this periodically.

/e: wget will also work, but cURL is more flexible if you ever need to go outside HTTP/FTP territory.

spinFX 11-23-2017 06:22 PM

Hey dseg, made a simple java app that can do what you want. (just need to have java8 installed (1.8 latest))

Basically choose http or https,
enter a URL you want to request (ie. www.google.com),
enter the interval of the requests in minutes,
and click start.
Then you can click the x to minimize to system tray so it doesn't bother you.





It logs the successful requests so you can see its running.

I'll put the source code on github in a sec in case you are worried it is doing something suspicious tongue.gif

link to zipped jar file on google drive:
https://drive.google.com/file/d/1eKaYhsBAhbKiXQp0dWY5keYvNooVts54/view?usp=sharing


All times are GMT -7. The time now is 12:07 AM.

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.

User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
vBulletin Security provided by vBSecurity (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.

vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.