%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/varak.net/www.varak.net/
Upload File :
Create Path :
Current File : /www/varak.net/www.varak.net/count.c

/**
 * Program pro pocitani veseleosti z access logu
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define BUFF 8192

main(int argc, char *argv[])
{
	FILE *f;
	char line[BUFF];

	char out[] = "Slohovka: %d\n\
Vse dohromady: %d\n\
Serpentshrine: %d\n\
The Eye: %d\n\
Hyjal Summit: %d\n\
Black Temple: %d\n\
Project Podpis: %d\n\
Waritko Avatar: %d\n\
Templars of Steel: %d\n\
Nalogovani Templari: %d\n\
Nirthy Signature: %d\n\
HTTP: %d\n";

	int slohovka = 0;
	int vse = 0;
	int serpent = 0;
	int eye = 0;
	int hyjal = 0;
	int bt = 0;
	int project = 0;
	int avatar = 0;
	int http = 0;
	int tos = 0;
	int templars = 0;
	int nirthy = 0;
	
	
	f = fopen(argv[1], "r");
	while(!feof(f))
	{
		fgets(line, BUFF-1, f);
		http++;

		if(strstr(line, "text.html"))
        	{
          		slohovka++;
			continue;
		}

		if(strstr(line, "WoWScrn"))
        	{
          		vse++;
		}

		if(strstr(line, "serpentshrine"))
        	{
          		serpent++;
			continue;
		}

		if(strstr(line, "the_eye"))
        	{
          		eye++;
			continue;
		}

		if(strstr(line, "hyjal"))
        	{
          		hyjal++;
			continue;
		}

		if(strstr(line, "black_temple"))
        	{
          		bt++;
			continue;
		}

		if(strstr(line, "pxangel.png"))
        	{
          		project++;
			continue;
		}

		if(strstr(line, "waritko_avatar_og.jpg"))
        	{
          		avatar++;
			continue;
		}

		if(strstr(line, "Templars\%20Of\%20Steel.mp3"))
        	{
          		tos++;
			continue;
		}
    if(strstr(line, "- templars"))
    {
      templars++;
			continue;
		}
		if(strstr(line, "nirthy.png"))
    {
      nirthy++;
			continue;
		}
	}
	printf(out, slohovka, vse, serpent, eye, hyjal, bt, project, avatar, tos, templars, nirthy, http);
}

Zerion Mini Shell 1.0