Mart
(KiX Supporter)
2020-01-28 04:22 PM
Web page carousel/loop

Hi guys,

We have several web based applications that show us the status of for example our cloud backup, network monitoring, wi-fi network status, etc.... In the past I have used a small kix script (see below) that displays a page, waits for x seconds, displays the next page, wait, etc.... Some quick and dirty code. This used to run in an endless loop until the script was topped and the browser was closed. It used IE but IE is a bit depreciated and we continuously get the message "The browser has stopped working....." stopping the loop at the page it was on when the error popped up. Tried multiple systems and clean installs. No luck, exact same issue.

Looking for something else that is stable. Does not have to be free but should not break the bank also. Suggestions are welcome. Maybe my code is just crappy and there are better ways to do this that I'm not aware off.

 Code:
Break on

$settingsfile = "D:\BrowserLoop\Files\Settings.ini"
$numberofsites = ReadProfileString($settingsfile, "Sites", "Number")

$objExplorer = CreateObject("InternetExplorer.Application")
$objExplorer.Visible = 1

While Not @ERROR
	For $index = 1 to $numberofsites
		$site = ReadProfileString($settingsfile, "Sites", "Site" + $index)
		$objExplorer.Navigate($site)
		Sleep 60
		If $index = $numberofsites
			$index = 0
		EndIf
	Next
Loop

$objExplorer.quit


INI file example
 Code:
[Sites]
Number=5
Site1=https://www.site1.com
Site2=https://www.site2.com
Site3=https://www.site3.com
Site4=https://www.site4.com
Site5=https://www.site5.com


ShaneEP
(MM club member)
2020-01-29 01:55 PM
Re: Web page carousel/loop

May be unrelated to your issue...

But shouldn't this...
 Code:
If $index = $numberofsites
	$index = 0
EndIf

Be...
 Code:
If $index = $numberofsites
	$index = 1
EndIf


ShaneEP
(MM club member)
2020-01-29 02:19 PM
Re: Web page carousel/loop

Nevermind. Settings the index to 0 is correct.

Unfortunately I can't get the code to work at all on my work computer. It navigates to the first page, then displays the next URL in a command windows. Might be some policy preventing it from working right. I'm not gonna be any help on this one.


Glenn BarnasAdministrator
(KiX Supporter)
2020-01-29 03:06 PM
Re: Web page carousel/loop

Mart - you have a PM. Might give you an alternative method to accomplish this.

Glenn


Mart
(KiX Supporter)
2020-01-30 11:41 AM
Re: Web page carousel/loop

@Shane, hmmmm....might be some IE policy that screws things up. Works fine for me but IE quits responding after a random amount time.

@Gelnn, Thanks. I'll keep you posted.


AllenAdministrator
(KiX Supporter)
2020-01-30 06:28 PM
Re: Web page carousel/loop

Chrome/Firefox Headless mode is another option. I'm researching it now, and will put some of my finds in the following thread as I have time.

http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=213805#Post213805


Mart
(KiX Supporter)
2020-02-10 05:26 PM
Re: Web page carousel/loop

Most things are simpler than it looks at first. I've been looking for solutions and trying a ton of things for this and in the end it is as simple as an addon for Chrome.

We will be starting chrome from the command line with all the URLs that need to be opened as parameters, click "Start switch" in the addon (after configuring it) and zooming to full screen mode.

It is so easy to overthink things.

https://chrome.google.com/webstore/detail/auto-tab-switch/iagkccjmbfoijhedememehigdjocdkhd


NTDOCAdministrator
(KiX Master)
2020-02-10 06:32 PM
Re: Web page carousel/loop

Might want to try the new Microsoft Edge based on Chromium

Very much like Google Chrome but Microsoft claims to have removed 150 code routines that were based on marketing and tracking of users


Mart
(KiX Supporter)
2020-02-12 02:59 PM
Re: Web page carousel/loop

Will do. Thanks.