Computing: Free Pascal Programming

Website downloads count.


Download dwnldcount desktop application (Windows 64bit) Download dwnldcount source code (Lazarus/Free Pascal)

Description: Very simple command line program, that may be used to count the downloads from a website. Counting is done for a given file type (given file extension) downloaded from one or two given directories on the webserver (URIs). What exactly has to be counted is described in a configuration file (dwnldcount.ini).
The input to the program are statistics text files, one or several for each month, containing a list of the number of downloads of the (normally all) files for the corresponding month. These files may easily be created manually by simply copying/pasting the list content, generated by website statistics applications as awstats into a text file.
The output of the program is a text file with a table, showing the counts for the different downloads considered per month. The first row shows the download of different files, i.e. how many of the considered files actually present in the considered directory have been downloaded during a given month; e.g. in August 181 Free Pascal executables of the 194 available; the second one shows the total monthly file download, i.e. how may times the considered files in the considered directory have been downloaded during a given month (resp. last column: during the actual year so far); e.g. 466 times that a Free Pascal executable has been downloaded in August.
For help with this program, have a look at the ReadMe.txt file, included within the program download archive.

Application change log.
Version 1.0 (September 2020): Original program.
Version 1.1 (December 2020):
  - Number of files considered for counting set to number of server files minus files to be excluded (thus files_server may be set to total number of files for considered extension).
Version 1.2 (January 2021):
  - Asking for the year, for which the counts have to be done (instead of assuming the current year).
  - For the current year, including the current month (instead of doing only until the preceding one).
Version 1.3 (April 2021):
  - Addition of a parameter to specify the output directory.
Version 2.0 (January 2022):
  - Adding a parameter to specify possible filename suffixes, allowing several files for a given month.
  - Adding the possibility to specify two webserver directories (instead of just one) for the different download counts.

Note: I wrote the new version 2.0 in first place for my own needs (necessity of 2 URIs after having changed the server location of the Free Pascal executables and convenience of file name suffixes to be able to directly use several month files, as for example one with the http and another with the https requests. These modifications may or not be useful for other people. Thus, you can still download the old version 1.3 from the Previous versions page.

Free Pascal features: Reading and writing text files (classic Pascal). Reading Free Pascal INI files.

Screenshot:

Download statistics command line program (program output file viewed in Notepad++)