
/* OpenWebSpider
 *
 *  Author:     Stefano Alimonti aka Shen139
 *  Mail:       shen139 [at] openwebspider (dot) org
 *
 *
 * This file is part of OpenWebSpider
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

/*


gcc -g -c sampleModFilter.c
gcc -g -shared -W1,-soname,sampleModFilter.so.0 -o sampleModFilter.so sampleModFilter.o -lc

*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "modHeader.h"


/* modFilter should return 1 if the current page must be indexed 0 if discarded*/
int modFilter (struct functArg* arg)
{
/*
this example function checks if the text of the current page has the string "xxx" if yes tells to the webspider to don't index the page otherwise index the page
*/
	if(arg)
		if(strstr(arg->text,"shen139")>arg->text)
			return 1;

return 0;
}

int modInitFilter (char* hostname, char* error)
{
/*on OK return 1*/
	return 1;


/* on ERROR return 0 - you can use the variabile error to report what happened
	strcpy(error,"test");
	return 0;
*/

}

