[Bast-commits] r9944 - ironman/Perlanet-IronMan/branches/dev/bin
idn at dev.catalyst.perl.org
idn at dev.catalyst.perl.org
Sat Sep 22 11:07:22 GMT 2012
Author: idn
Date: 2012-09-22 11:07:22 +0000 (Sat, 22 Sep 2012)
New Revision: 9944
Added:
ironman/Perlanet-IronMan/branches/dev/bin/delete-spam.pl
ironman/Perlanet-IronMan/branches/dev/bin/ironman-collector-cron-wrapper.sh
ironman/Perlanet-IronMan/branches/dev/bin/ironman-collector-rotate.sh
Log:
Adding files from trunk
Added: ironman/Perlanet-IronMan/branches/dev/bin/delete-spam.pl
===================================================================
--- ironman/Perlanet-IronMan/branches/dev/bin/delete-spam.pl (rev 0)
+++ ironman/Perlanet-IronMan/branches/dev/bin/delete-spam.pl 2012-09-22 11:07:22 UTC (rev 9944)
@@ -0,0 +1,71 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+=head1 SYNOPSIS
+
+ perl delete-spam.pl --db_path=/home/graeme/workspace/Ironman/ironman.db
+
+This script removes spammy content from the posts database and thus the feed.
+
+=cut
+
+use Data::Dumper;
+
+use IronMan::Schema;
+
+my ( $db_path );
+GetOptions(
+ 'db_path=s' => \$db_path,
+) or die pod2usage;
+
+unless($db_path) {
+ die pod2usage;
+}
+
+my $schema = IronMan::Schema->connect("dbi:SQLite:$db_path");
+
+my $banned = {};
+
+$banned->{domains}->{feeds.launchpad.net} = 1;
+$banned->{domains}->{feetloversblog.com} = 1;
+$banned->{domains}->{themarketarticles.com} = 1;
+$banned->{domains}->{femdomface.com} = 1;
+$banned->{domains}->{shemalecumfest.com} = 1;
+$banned->{domains}->{dementia.org} = 1;
+$banned->{domains}->{dementia.org} = 1;
+$banned->{domains}->{digitalffs.com} = 1;
+$banned->{domains}->{goutmatter.com} = 1;
+$banned->{domains}->{paintreatmentblog.com} = 1;
+
+#$banned->{domains}->{} = 1;
+#$banned->{domains}->{} = 1;
+#$banned->{domains}->{} = 1;
+#$banned->{domains}->{} = 1;
+#$banned->{domains}->{} = 1;
+#$banned->{domains}->{} = 1;
+#$banned->{domains}->{} = 1;
+#$banned->{domains}->{} = 1;
+#$banned->{domains}->{} = 1;
+
+
+$banned->{names}->{xanax} = 1;
+$banned->{names}->{penis} = 1;
+$banned->{names}->{femdom} = 1;
+$banned->{names}->{shemale} = 1;
+$banned->{names}->{levitra} = 1;
+$banned->{names}->{cialis} = 1;
+
+#$banned->{names}->{} = 1;
+#$banned->{names}->{} = 1;
+#$banned->{names}->{} = 1;
+#$banned->{names}->{} = 1;
+#$banned->{names}->{} = 1;
+#$banned->{names}->{} = 1;
+
+
+
+#Grab the feeds with no links.
+my @feeds = $schema->resultset('Feed')->search({ link => undef })->all;
+
Added: ironman/Perlanet-IronMan/branches/dev/bin/ironman-collector-cron-wrapper.sh
===================================================================
--- ironman/Perlanet-IronMan/branches/dev/bin/ironman-collector-cron-wrapper.sh (rev 0)
+++ ironman/Perlanet-IronMan/branches/dev/bin/ironman-collector-cron-wrapper.sh 2012-09-22 11:07:22 UTC (rev 9944)
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)
+
+# This is the cron wrapper for collecting the IronMan blogging feeds
+
+# Date YYYYMMDD-H
+DATE=`date +%Y%m%d-%H%M`
+
+BASE=/var/www/ironman.enlightenedperl.org
+
+# ironman-collector script
+SCRIPT=$BASE/ironman/Perlanet-IronMan/bin/ironman-collector.pl
+
+# Logfile
+LOG=$BASE/collector-logs/$DATE
+
+$SCRIPT --dsn=dbi:SQLite:$BASE/ironman/subscriptions.db > $LOG 2>&1
Property changes on: ironman/Perlanet-IronMan/branches/dev/bin/ironman-collector-cron-wrapper.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: ironman/Perlanet-IronMan/branches/dev/bin/ironman-collector-rotate.sh
===================================================================
--- ironman/Perlanet-IronMan/branches/dev/bin/ironman-collector-rotate.sh (rev 0)
+++ ironman/Perlanet-IronMan/branches/dev/bin/ironman-collector-rotate.sh 2012-09-22 11:07:22 UTC (rev 9944)
@@ -0,0 +1,2 @@
+DIR=/var/www/ironman.enlightenedperl.org/collector-logs/
+find $DIR -type f -ctime +7 -exec echo rm \{} \; ; find $DIR -type f -ctime +3 -exec gzip \{} \;
Property changes on: ironman/Perlanet-IronMan/branches/dev/bin/ironman-collector-rotate.sh
___________________________________________________________________
Added: svn:executable
+ *
More information about the Bast-commits
mailing list