Contact

#!/usr/bin/perl
use strict;
use warnings;

my $input = do { local $/; <STDIN> };

# --- Extract handles ---
my %handles;
while ($input =~ /@([A-Za-z0-9_]{1,30})/g) {
    $handles{$1} = 1;
}

# --- Extract hashtags ---
my %hashtags;
while ($input =~ /#([A-Za-z0-9_]+)/g) {
    $hashtags{$1} = 1;
}

# --- Emotional tone detection ---
my @emotion;
push @emotion, "exasperated" if $input =~ /\bexasperated\b/i;
push @emotion, "indignant"   if $input =~ /\bindignant\b/i;
push @emotion, "idiot"       if $input =~ /\bidiot\b/i;

# --- Spanish idiom detection ---
my $spanish_idiom = ($input =~ /fuego.*pantal[oó]n/i) ? 1 : 0;

# --- External link detection ---
my @links = ($input =~ m{https?://[^\s]+}g);

# --- Schizophasia markers ---
my @schizo;
push @schizo, "fragmented" if $input =~ /\b(?:and|but|so)\s+(?:and|but|so)\b/i;
push @schizo, "jumpiness"  if $input =~ /\bjump\b.*\btopic\b/i;
push @schizo, "nonlinear"  if $input =~ /\bthreadbear\b|\bbreakingvibe\b|\bjcow\b/i;

# --- Normalize text ---
my $norm = $input;
$norm =~ s/[^\w\s\-]/ /g;
$norm =~ s/\s+/ /g;

# --- Slug generator ---
sub slug {
    my ($t) = @_;
    $t = lc($t);
    $t =~ s/[^a-z0-9\s]+//g;
    $t =~ s/\s+/ /g;
    $t =~ s/ /-/g;
    return $t;
}

my $slug = slug($norm);

# --- Build wiki URL ---
my $base = "https://www.lowmaintenancesweetheart.online/index.php?title=";
my $url  = $base . $slug;

# --- Output ---
print "\n=== Handles ===\n";
print "\@$h\n" for sort keys %handles;

print "\n=== Hashtags ===\n";
print "#$_\n" for sort keys %hashtags;

print "\n=== Emotional Tone ===\n";
print join(", ", @emotion), "\n";

print "\n=== Schizophasia Flags ===\n";
print join(", ", @schizo), "\n";

print "\n=== Spanish Idiom Detected ===\n";
print $spanish_idiom ? "yes\n" : "no\n";

print "\n=== External Links ===\n";
print "$_\n" for @links;

print "\n=== Normalized Text ===\n$norm\n";

print "\n=== SEO URL ===\n$url\n";