Skip to content

Commit

Permalink
bulk commit of commands
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.muze.nl/svn/multigate_commands/trunk@9 07fb6d0f-9701-0410-8146-bd1aaf089aca
  • Loading branch information
Wieger Opmeer committed Oct 15, 2005
1 parent bd0915a commit 1c8f47e
Show file tree
Hide file tree
Showing 832 changed files with 58,799 additions and 0 deletions.
24 changes: 24 additions & 0 deletions aankoppel/aankoppel.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/perl -w

use lib '../../lib';

#User management from multigate
use Multigate::Users;
use Multigate::Util;

## Import available environment variables

my $address = $ENV{'MULTI_USER'}; # address of invoking user
my $user = $ENV{'MULTI_REALUSER'}; # multigate username of invoking user
my $protocol = $ENV{'MULTI_FROM'}; # protocol this command was invoked from

$address = stripnick($address); #make sure we do not have irc-channels in database

Multigate::Users::init_users_module();

my $result = set_preferred_protocol( $user, $protocol );
my $result2 = set_main_address( $user, $protocol, $address );

print "Setting followme to ($protocol, $address) for $user.\n";

Multigate::Users::cleanup_users_module();
1 change: 1 addition & 0 deletions aankoppel/command.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
level = 50
1 change: 1 addition & 0 deletions aankoppel/help.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
aankoppel: sets preferred protocol to from_protocol, and main_address to from-address
106 changes: 106 additions & 0 deletions aex/aex.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#!/usr/bin/perl -w
# Casper Joost Eyckelhof (Titanhead)
# [email protected]

use LWP::UserAgent;
use HTTP::Cookies;
use strict;

#### allerlei fijne definities en initialisaties ########
my $ua = new LWP::UserAgent;
my @agents = (
"Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)", "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)",
"Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"
);
my $agent = @agents[ int( rand(@agents) ) ];
$ua->agent($agent);

my $baseurl = "http://www.aex.nl/scripts/pop/kb.asp?taal=nl&alf=";
my $commandline = $ARGV[0];

$commandline = "aex" unless ( defined $commandline and ( $commandline ne "" ) );

sub getFonds {
my $fonds = shift;
$agent = @agents[ int( rand(@agents) ) ];
$ua->agent($agent);
my $request = new HTTP::Request( 'GET', $baseurl . $fonds );
my $response = $ua->request($request);
my $html = $response->content;

my @lines = split /\n/, $html;
my @values = ();
foreach my $line (@lines) {
if ( $line =~ /^(\d+\.\d{2})/ ) {
push @values, $1;
}
}
my ( $current, $hoog, $laag, $open, $vorigslot ) = ( $values[0], $values[3], $values[4], $values[5], $values[6] );
my %thisfonds = (
"naam" => $fonds,
"koers" => $current,
"hoog" => $hoog,
"laag" => $laag,
"vorigslot" => $vorigslot,
"open" => $open
);
return %thisfonds;
}

sub america {
my $fonds = shift;

my $url = "http://www.fd.nl/TopMarkets.asp?Context=N%7C0&BgColor=%23E5E4D9";

my $request = new HTTP::Request( 'GET', $url );
my $response = $ua->request($request);
my $html = $response->content;
my @lines = split /\n/, $html;
my %values = ();
foreach my $line (@lines) {

## print "--> $line\n";
## AEX</a></td><td class="tabletekst" align="right">281,09</td><td class="tabletekst" align="right"><span style="color: #FF0000">-2,67%</span>
if ( $line =~
m|(\w+)</a></td><td class="tabletekst" align="right".*?>(\d+.*?,\d{2})</td><td class="tabletekst" align="right".*?><span style="color: #FF0000">(.*?)\%</span>|
)
{
my $key = lc($1);
my $val = $2;
my $perc = $3;
$val =~ s/\.//g;
$val =~ s/,/./g;
$values{$key} = $val;

#print "HIT: $key - $val\n";

if ( lc($fonds) eq $key ) {
print "$fonds: $val ($perc%)\n";
exit 0;
}

}
}
print "Sorry, $fonds niet gevonden\n";
exit 0;
}

if ( ( $commandline =~ /^aex/i ) || ( $commandline =~ /^nasd/i ) || ( $commandline =~ /^dow/i ) ) {
my %values = america($commandline);
if ( defined $values{koers} ) {
print
"$commandline: $values{koers} open=$values{open} hoogste=$values{hoog} laagste=$values{laag} slot vorig=$values{vorigslot} verschil="
. sprintf( "%.2f", ( $values{koers} - $values{vorigslot} ) ) . "\n";
} else {
print "Bestaat $commandline wel? Kan het niet vinden.\n";
}
} else {
my %values = getFonds($commandline);
if ( defined $values{koers} ) {
print
"$commandline: $values{koers} open=$values{open} hoogste=$values{hoog} laagste=$values{laag} slot vorig=$values{vorigslot} verschil="
. sprintf( "%.2f", ( $values{koers} - $values{vorigslot} ) ) . "\n";
} else {
print "Bestaat $commandline wel? Kan het even niet vinden.\n";
}
}
106 changes: 106 additions & 0 deletions aex/aex2.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#!/usr/bin/perl -w
# Casper Joost Eyckelhof (Titanhead)
# [email protected]

use LWP::UserAgent;
use HTTP::Cookies;
use strict;

#### allerlei fijne definities en initialisaties ########
my $ua = new LWP::UserAgent;
my @agents = (
"Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)", "Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)",
"Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"
);
my $agent = @agents[ int( rand(@agents) ) ];
$ua->agent($agent);

my $baseurl = "http://www.aex.nl/scripts/pop/kb.asp?taal=nl&alf=";
my $commandline = $ARGV[0];

$commandline = "aex" unless ( defined $commandline );

sub getFonds {
my $fonds = shift;
$agent = @agents[ int( rand(@agents) ) ];
$ua->agent($agent);
my $request = new HTTP::Request( 'GET', $baseurl . $fonds );
my $response = $ua->request($request);
my $html = $response->content;

my @lines = split /\n/, $html;
my @values = ();
foreach my $line (@lines) {
if ( $line =~ /^(\d+\.\d{2})/ ) {
push @values, $1;
}
}
my ( $current, $hoog, $laag, $open, $vorigslot ) = ( $values[0], $values[3], $values[4], $values[5], $values[6] );
my %thisfonds = (
"naam" => $fonds,
"koers" => $current,
"hoog" => $hoog,
"laag" => $laag,
"vorigslot" => $vorigslot,
"open" => $open
);
return %thisfonds;
}

sub america {
my $fonds = shift;

my $url = "http://www.fd.nl/TopMarkets.asp?Context=N%7C0&BgColor=%23E5E4D9";

my $request = new HTTP::Request( 'GET', $url );
my $response = $ua->request($request);
my $html = $response->content;
my @lines = split /\n/, $html;
my %values = ();
foreach my $line (@lines) {

## print "--> $line\n";
## AEX</a></td><td class="tabletekst" align="right">281,09</td><td class="tabletekst" align="right"><span style="color: #FF0000">-2,67%</span>
if ( $line =~
m|(\w+)</a></td><td class="tabletekst" align="right".*?>(\d+.*?,\d{2})</td><td class="tabletekst" align="right".*?><span style="color: #FF0000">(.*?)\%</span>|
)
{
my $key = lc($1);
my $val = $2;
my $perc = $3;
$val =~ s/\.//g;
$val =~ s/,/./g;
$values{$key} = $val;

#print "HIT: $key - $val\n";

if ( lc($fonds) eq $key ) {
print "$fonds: $val ($perc)\n";
exit 0;
}

}
}
print "Sorry, $fonds niet gevonden\n";
exit 0;
}

if ( ( $commandline =~ /^aex/i ) || ( $commandline =~ /^nasd/i ) || ( $commandline =~ /^dow/i ) ) {
my %values = america($commandline);
if ( defined $values{koers} ) {
print
"$commandline: $values{koers} open=$values{open} hoogste=$values{hoog} laagste=$values{laag} slot vorig=$values{vorigslot} verschil="
. sprintf( "%.2f", ( $values{koers} - $values{vorigslot} ) ) . "\n";
} else {
print "Bestaat $commandline wel? Kan het niet vinden.\n";
}
} else {
my %values = getFonds($commandline);
if ( defined $values{koers} ) {
print
"$commandline: $values{koers} open=$values{open} hoogste=$values{hoog} laagste=$values{laag} slot vorig=$values{vorigslot} verschil="
. sprintf( "%.2f", ( $values{koers} - $values{vorigslot} ) ) . "\n";
} else {
print "Bestaat $commandline wel? Kan het even niet vinden.\n";
}
}
2 changes: 2 additions & 0 deletions aex/command.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
level = 100
cache = 120 #2 minutes
1 change: 1 addition & 0 deletions aex/help.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Geeft de huidige AEX koers weer.
1 change: 1 addition & 0 deletions aex/level
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
100
46 changes: 46 additions & 0 deletions afkoppel/afkoppel.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/perl -w
## Import available environment variables

use File::stat;
my $realuser = $ENV{'MULTI_REALUSER'}; # multigate username of invoking user
my $locked = 0;

# Loek is raar
# Maar Titan kan ook rare regels in een script plakken!
exit 0 if ( lc($realuser) eq "loek" );

my $lockfile = "data/$realuser";

#check time-lock on this user
if ( -e $lockfile ) {
my $stat = stat $lockfile or die "Error opening lockcheckfile: $!\n";
$locked = ( $stat->mtime > time() );
}

if ($locked) {

#do we want to refresh our lock??
#if so: move this statement after lockfilewriting
exit 0;
}

#create new lockfile
open CACHE, "> $lockfile" or die "cannot write to file!";
close CACHE;

#modify time on lockfile
my $cachetime = time + 300; # 5 minutes into the future
utime $cachetime, $cachetime, $lockfile;

#the thing this command is about:
if ( int( rand(100) ) < 30 ) {
open( MSG, "< afkoppel.txt" );
my @opties = <MSG>;
close MSG;

my $antwoord = $opties[ int( rand(@opties) ) ];
$antwoord =~ s/XX/$realuser/;
print "$antwoord";
} else {
exit 0;
}
45 changes: 45 additions & 0 deletions afkoppel/afkoppel.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Dag XX
Welterusten XX
Doei!
Nou dag hoor XX
Hasta la vista! XX!
Stand clear. Disengaging XX.
Tot zover deze live verbinding met XX.
We'll meet again, XX.
Afkoppel? Afkoppel? Rare XX!
Beaming up XX
Dag XX.
XX: Kom je snel weer terug?
Ciao
A bientot XX.
Auf Wiedersehen.
Selamat jalan.
Adios XX.
Hej d� XX.
Tot de volgende keer maar weer.
Zijn we zo saai XX?
Tot frop!
Nu al?
Dat is vroeg, XX.
Slaap lekker XX.
Alweer?
Zeker weer naar de vb, XX?
Afkoppelen is voor watjes!
Wow XX, zonder typo's :)
Truste XX
En morgen gezond weer op.
An !afkoppel a day, keeps the sleep away
Peer weet je te vinden, XX.
Trossen los.
Niet meer gezellig hier?
See you later, Multigator...
Toedeledokie XX!
Dag Sinterklaasje^WXX
I do wish we could chat longer, but I'm having an old friend for dinner. Bye.
So this is what a chatroom looks like.
You say goodbye and I say hello
aangekoppel ingekoppel vasgekoppel losgekoppel afkoppel saamkoppel
We moeten rennen, springen, vliegen, duiken, vallen, opstaan en weer doorgaan...
We kunnen nu niet blijven, we kunnen nu niet langer blijven staan
Afkicken? go Go GOO XX!!!
*Setting a tracking cookie on XX*
2 changes: 2 additions & 0 deletions afkoppel/command.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
level = 50
user = 0
Empty file added afkoppel/data/OH
Empty file.
Empty file added afkoppel/data/angel_7th
Empty file.
Empty file added afkoppel/data/ascent
Empty file.
Empty file added afkoppel/data/bbart
Empty file.
Empty file added afkoppel/data/brie
Empty file.
Empty file added afkoppel/data/ctlaltdel
Empty file.
Empty file added afkoppel/data/dabutcha
Empty file.
Empty file added afkoppel/data/diddlien
Empty file.
Empty file added afkoppel/data/eppo
Empty file.
Empty file added afkoppel/data/evo
Empty file.
Empty file added afkoppel/data/foxm
Empty file.
Empty file added afkoppel/data/fvdh
Empty file.
Empty file added afkoppel/data/grit
Empty file.
Empty file added afkoppel/data/gwen
Empty file.
Empty file added afkoppel/data/hasting
Empty file.
Empty file added afkoppel/data/iq-0
Empty file.
Empty file added afkoppel/data/jacques
Empty file.
Empty file added afkoppel/data/loek
Empty file.
Empty file added afkoppel/data/maniosus
Empty file.
Empty file added afkoppel/data/mars
Empty file.
Empty file added afkoppel/data/mjrider
Empty file.
Empty file added afkoppel/data/mrjb
Empty file.
Empty file added afkoppel/data/npar
Empty file.
Empty file added afkoppel/data/oxo
Empty file.
Empty file added afkoppel/data/oxonium
Empty file.
Empty file added afkoppel/data/pervy
Empty file.
Empty file added afkoppel/data/pip
Empty file.
Empty file added afkoppel/data/poef
Empty file.
Empty file added afkoppel/data/rien
Empty file.
Empty file added afkoppel/data/schubi
Empty file.
Empty file added afkoppel/data/sim
Empty file.
Empty file added afkoppel/data/sjois
Empty file.
Empty file added afkoppel/data/socrates
Empty file.
Empty file added afkoppel/data/speedy
Empty file.
Empty file added afkoppel/data/synq
Empty file.
Empty file added afkoppel/data/titanhead
Empty file.
Empty file added afkoppel/data/tonytee
Empty file.
Empty file added afkoppel/data/tovenaar
Empty file.
Empty file added afkoppel/data/tsd
Empty file.
Empty file added afkoppel/data/wieger
Empty file.
Empty file added afkoppel/data/wiggy
Empty file.
Empty file added afkoppel/data/yaxmir
Empty file.
Empty file added afkoppel/data/ylebre
Empty file.
1 change: 1 addition & 0 deletions afkoppel/help.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
afkoppel geeft aan dat de gebruiker bij zijn terminal weggaat.
2 changes: 2 additions & 0 deletions alex/alex.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/perl -w
print "Telefoonnummer Alex Bierservice: 053 - 4338460\n"
1 change: 1 addition & 0 deletions alex/command.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
level = 100
1 change: 1 addition & 0 deletions alex/help.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Geeft telefoonnummer van Alex Bierservice (053 - 4338460)
1 change: 1 addition & 0 deletions alex/level
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
100
Loading

0 comments on commit 1c8f47e

Please sign in to comment.