Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Universalthread Login
Message
General information
Forum:
Level Extreme
Category:
Other
Miscellaneous
Thread ID:
00674394
Message ID:
00674614
Views:
24
Can I tell yo again, how great this script is.
I have now used it for 4 seperate web sites, I have to log onto various times in the day.
This is a real time saver.

Thanks !!
Bob Lee



>>Is there any way (an alt login) which can store on my local machine a 'cookie' or a unique url which I can use which logs me into this universalthread in one click. ?
>>
>>Thanks in advance.
>>Bob Lee
>
>How about by scripting.
>I use the following two script files, the first specific to UT the second is a general purpose logon script which works for most of the sites I use that require username/password logon. (You will need to modify un = "myname" & pw = "mypassword" - tmo can be modified if to a suitable timeout)
>
>log_ut.js
>
>//*******************************************************************************************
>// Initialise variables
>//   First is the required URL & timeout for page to load
>//   Next is the form name & the user/password input fields
>//   Next is the actual user name & password
>//~******************************************************************************************
>url="http://www.levelextreme.com"
>tmo = 60 * 1000
>
>frm="Login"
>unf="Username"
>pwf="Password"
>
>un = "myname"
>pw = "mypassword"
>
>var wsh = WScript.CreateObject( "WScript.Shell" )
>wsh.Run( "autolog.js " + url + " " + tmo + " "+ frm + " "+ unf + " "+ pwf + " "+ un + " "+ pw, 1, 0 )
>
>
>autolog.js
>
>//~******************************************************************************************
>// Create Script Shell for error reporting
>//~******************************************************************************************
>var wsh = WScript.CreateObject( "WScript.Shell" )
>
>//*******************************************************************************************
>// Check parameters
>//   1st is the required URL
>//   2nd is timeout for page to load
>//   3rd is the form name
>//   4th is the user input field name
>//   5th is password input field name
>//   6th is the actual user name
>//   7th is the actual password
>//~******************************************************************************************
>var argo = WScript.Arguments
>if ( argo.Length != 7 )
>  {
>  wsh.popup( "Invalid Number Of Parameters" )
>  Quit
>  }
>
>url = argo(0)
>tmo = argo(1)
>
>frm=argo(2)
>unf=argo(3)
>pwf=argo(4)
>
>un = argo(5)
>pw = argo(6)
>
>//~******************************************************************************************
>//   Create IE object, default is invisible, so make visible
>//~******************************************************************************************
>var oc = new ActiveXObject( "internetexplorer.application" ) ;
>oc.visible = 1
>
>//~******************************************************************************************
>// Navigate to required page
>//   Check for page fully loaded - occassionally busy is set to False before page is
>//       fully loaded, ReadyState is more reliable (probably could check only that)
>//   Timeout check while loading
>//~******************************************************************************************
>oc.navigate( url )
>dtes = new Date().valueOf()
>tmeout = false
>while ( oc.busy || (oc.ReadyState != 4) )
>  {
>  dten = new Date().valueOf()
>  if ( (dten - dtes) > tmo )
>    {
>    tmeout = true
>    break
>    }
>  }
>if ( tmeout )
>  {
>  wsh.popup( "Timed Out" )
>  Quit
>  }
>
>//~******************************************************************************************
>// Fill in fields & submit if possible
>//   Error if cannot find the form
>//~******************************************************************************************
>tstpg = frm in oc.Document
>if ( tstpg )
>  {				// create basic string for form on document
>  frms = "oc.Document." + frm + "."
>				// put user name into to user input field
>  eval( frms+unf + ".value = un" )
>				// put password into to password input field
>  eval( frms+pwf + ".value = pw" )
>				// submit form
>  eval( frms+"submit()" )
>  }
>else
>  wsh.popup( "No Logon Form" )
>
In the beginning, there was a command prompt, and all was well.
Previous
Reply
Map
View

Click here to load this message in the networking platform