I have been tinkering with VBS on this issue. I have a script that kinda-sorta works, and what doesn't seem to work is very puzzling. When I get back to the office I will post the script for your review... if you're so inclined. Thank you for being so patient and helpful with this.
04-09-2014, 09:01 PM
If all else fails, you can always do the trick of dynamically adding a script tag to the page which in reality sends data to an active program, as in
var head = document.getElementsByTagName('head');
var notAJAX = document.createElement('script');
notAJAX.src = "http://whereEver.com/destination.php&myData=stuffToBeSent";
It does have all the limitations of any GET call, but you don't have any "common origin" problems.
04-10-2014, 06:10 AM
Tcobb - Where in the script does this belong, and what else would I need to edit? It appears I would simply put this at the beginning of the HTML file to run on the local machine and simply edit the notAJAX.src URL. Am I missing anything else here?
04-10-2014, 11:24 AM
Here is the portion of the VBS that is not working. For some reason, CTRL+A doesn't execute. Any thoughts as to what might be going wrong?
04-10-2014, 01:51 PM
I have fixed the VBS by adding sleep commands after each CTRL+X SendKeys. I now have a CSV of the data from the stalist.cgi page.
04-10-2014, 02:15 PM
Well it looks like VBS is turning out to be a real hero for your problems.
Are you able to import the CSV yourself or do you need some scripting for that?
04-10-2014, 02:34 PM
I really appreciate all your help. I'm taking a stab at importing the CSV's and I've already made some progress. The problem I'm going to have is having the script cycle through all the CSV's in a folder for import, then deleting all files after upload.
04-10-2014, 03:39 PM
Now comes the fun part... putting everything where it belongs.
I have attached the script I am using to import the information from the CSV into the MySQL database. My goals:
Get the file name for entry into the database (I can pass this in the URL if needed)
Remove the erroneous three rows at the top of each CSV file (two blank rows and one header row)
Have the script cycle through and execute for all CSV's in the directory
Delete the CSV's after being imported
My thought is that the individual laptops will run the script to get the data from stalist.cgi and upload the CSV every hour. Then, half-past every hour, this script will run that imports all CSV files into the database. This gives the computers time to process and upload and ensure I have the most accurate data possible.
Here is the script I have started with. As you can tell, I am specifying one particular CSV file to be read. I haven't figured out a way to have the script execute for all files. TIMTACULAR is the name of my computer, so you can see that the computer name is used the filename. It makes no difference to be whether the file name, or computer name (via URL) is used.
$link_id = mysql_connect("localhost", "**", "***") or die("Could not connect."); if(!mysql_select_db("speedtest",$link_id)) die("database was not selected.");