Page 1 of 1 1
Topic Options
#213806 - 2020-01-28 04:22 PM Web page carousel/loop
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4653
Loc: The Netherlands
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
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#213808 - 2020-01-29 01:55 PM Re: Web page carousel/loop [Re: Mart]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2090
Loc: Tulsa, OK
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

Top
#213809 - 2020-01-29 02:19 PM Re: Web page carousel/loop [Re: ShaneEP]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2090
Loc: Tulsa, OK
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.

Top
#213810 - 2020-01-29 03:06 PM Re: Web page carousel/loop [Re: ShaneEP]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4318
Loc: New Jersey
Mart - you have a PM. Might give you an alternative method to accomplish this.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#213811 - 2020-01-30 11:41 AM Re: Web page carousel/loop [Re: Glenn Barnas]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4653
Loc: The Netherlands
@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.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#213814 - 2020-01-30 06:28 PM Re: Web page carousel/loop [Re: Mart]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4499
Loc: USA
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

Top
#213823 - 2020-02-10 05:26 PM Re: Web page carousel/loop [Re: Allen]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4653
Loc: The Netherlands
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
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#213824 - 2020-02-10 06:32 PM Re: Web page carousel/loop [Re: Mart]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11590
Loc: CA
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

Top
#213825 - 2020-02-12 02:59 PM Re: Web page carousel/loop [Re: NTDOC]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4653
Loc: The Netherlands
Will do. Thanks.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 58 anonymous users online.
Newest Members
Onsitejim, nexup3000, Luis_Ballesteros, Young, marielia
17725 Registered Users

Generated in 0.037 seconds in which 0.011 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org