This tutorial tells how to update your stats automatically.
Configure mIRCStats FTP upload settings
First, run mIRCStats normally and set the stats generation settings as you like.
When you’re done, run the stats by pressing “Make stats” and after that go to “File Transfer” settings page in mIRCStats. Here you can define settings that mIRCStats uses to upload your stats to the web server.
Most internet service providers have some web space for every user that can be accessed by FTP (= File Transfer Protocol). To use FTP you need to know these 3 things:
- FTP server name
- Your username
- Your password
You should find these in your internet service contract. If not, use Google to search for “<your internet service provider name> FTP” or contact their customer support.
When you have found the settings, use any FTP client to verify that they are correct. I suggest you try FileZilla FTP client.
Also, you should take a look at the directory structure at the server. The directory that’s visible in the internet is usually called “public_html” or “www”. You can create “stats” sub-directory under it. This makes your stats pages appear in address like http://www.yourserver.com/~username/stats/mystats.html
You can publish your stats manually by uploading “Html” sub-directory contents under your mIRCStats directory to your web server.
mIRCStats can do the same automatically when the stats are generated. Just fill in the server name, username and password and the target directory (e.g. “public_html/stats”) to File Transfer page and press the “Test” button. If everything goes ok, mIRCStats uploads your stats page to the web server.
Now activate the FTP uploading and automode with these two settings:
- Enable “FTP Upload Enabled” at “File Transfer” settings page
- Enable “Automatic mode on the next run” at “Main Options/Application” settings page.
(Using the -log <logfile> command line parameter also forces mIRCStats to be started in automatic mode, see below).
Save your mIRCStats configuration now. You can use different configuration files for each of your stats, e.g. “mychannel.cfg”, “facebook.cfg”, “twitter.cfg” etc.
Run mIRCStats automatically
mIRCStats can be launched with any task scheduler or script. Command line parameters can be used to pass runtime info to mIRCStats:
For detailed info about these, press F1 in mIRCStats to open the help and go to “Inside mIRCStats / Command line parameters” chapter.
A simple way is to define a batch file (.bat) and set your mIRCStats launch commands there. Then use Windows Task Scheduler to run the batch file periodically. Here’s how you can do it.
1. Create a batch file with your mIRCStats launch commands
Open NotePad from the Start menu and add this line into the empty file:
START /WAIT C:\”Program Files”\mircstats\mircstats.exe -cfg myconfig.cfg
START /WAIT C:\”Program Files”\mircstats\mircstats.exe -log “C:\Logs\My channel*.log” -cfg myconfig.cfg
Use the correct mIRCStats path (use quotes if any directory in the path contains spaces, see the example above) and the correct mIRCStats configuration file name that you just saved.
In NotePad, to go “File->Save as…” and browse to the desired directory. I suggest you try “Desktop” that easiest to access. Then select “Save as type: All Files” and enter a descriptive file name like “makestats.bat” and press Save.
See your desktop now, the new “makestats” icon should be there. Run the stats manually by pressing it. mIRCStats should start in automode, generate the stats and then upload the stats page to your web server.
2. Run the batch file automatically
Go to Start -> Control Panel -> Scheduled Tasks. Here you can define any application to be lauched automatically for example once per day. You should now define the newly created “makestats.bat” to be launched automatically when you like.
Adding a new scheduled task is done differently in various Windows versions so see these links for OS version specific info:
- Windows 7: How to schedule a Batch File to run automatically in Windows 7
- Windows XP & Vista: How to schedule a batch file to run in XP
Specify the time that’s most suitable for you because when the stats are generated, the batch file window and mIRCStats windows pop up. On your personal PC you don’t usually need to specify the username and password if you check “Run only if logged on” (or such).
When the scheduled task is defined, it will run the stats automatically when specified. You can test the task by starting it manually from Scheduled Tasks window by right-clicking and selecting “Run”.
You can now add more stats to be generated automatically to “makestats.bat” by adding new lines to it. You can use the same configuration file for different stats by specifying the log file file filter in the command line, see the 2nd example above. Each mIRCStats line in the batch file is executed one by one (due to “START /WAIT …”) so the stats generation doesn’t use all your CPU and memory resources by running multiple mIRCStats instances simultaneously.
See the list of all RSSLogger & mIRCStats tutorials here: viewforum.php?f=11