I wrote some code to help with the https://voat.co/v/QRV/3745232 post, titled "Did James Comey use a grille cipher to place a hit on Bobby Kennedy's granddaughter and her son via Twitter or is this just another weird coincidence?" (and also posted it there as a comment).
I'll copy it below. I should really put it on a site to make it easier but then of course it'd be easier to attack. This way, you can run it locally. Run it like:
perl find-word.pl maeve fahey kennedy townsend gideon mckean
and it'll give this output:
Searching ["Our national identity is being remade in real time. What had once seemed a bitter and divided society now seems more like a nation of people finding creative ways to show up for one another." - @nytdavidbrooks]
Searching for [maeve]: found.
Searching for [fahey]: found.
Searching for [kennedy]: found.
Searching for [townsend]: found.
Searching for [gideon]: found.
Searching for [mckean]: found.
Returning [1] ALL FOUND
I put Comey's tweet in as the default text; you can change the text to search by adding "--text='the text to search'".
Note that I didn't code anything to do with the grille cipher; this script just helps with the search for word(s) within a larger text, each word of which might be broken up.
The search matches regardless of whether the letter is capitalized or not.
Code is below, in a "code" block so hopefully it's copy/paste-able (verified during preview; this should work). Also neat that I recorded the time I started as well, so I can say that this took less than an hour to write (the comment, and this post, took longer :) ).
#!/usr/bin/perl
=head1 find-word.pl
This script will search text for specified words; the words might be broken up.
Author: unknown :)
Date: 2020-04-04 Sat 11:27
=cut
=head2 ALWAYS USE STRICT AND WARNINGS
=cut
use strict;
use warnings;
=head2 MODULES USED FROM CPAN
=cut
use Getopt::Long;
=head2 MODULES WRITTEN IN-HOUSE
=cut
=head2 VARIABLE DECLARATIONS
=cut
my $verbose = 0; # invoke with "--verbose" to turn on more output.
my @words; # word(s) to search for, might be broken up.
my $comey = "\"Our national identity is being remade in real time. What had once seemed a bitter and divided society now seems more like a nation of people finding creative ways to show up for one another.\" - \@nytdavidbrooks";
my $string = $comey; # string to search within.
=head2 SUBROUTINE DECLARATIONS
=cut
sub main();
=head2 MAIN FUNCTION
Note that we first call setup_aspect_log(), and THEN exit main() -- previously I had the call to setup_aspect_log() inside the
main() sub, so it wasn't showing "Entering" and "Leaving" main(); now it will.
=cut
exit main();
=head2 SUBROUTINE DEFINITIONS
=cut
=head2 main
Main routine, which will try to find a word in another string. Exits with errorlevel 0 if found, 1 otherwise.
=cut
sub main() {
# Return code; default to failure.
my $rc = -1;
# First, validate our options.
GetOptions( "verbose" => \$verbose,
"word=s" => \@words,
"string=s" => \$string,
) or die "Error in command line arguments.\n";
# Any remaining bare args should go into @words.
push @words, @ARGV;
# Check that we have a word and string passed in.
if ( scalar @words == 0 or !defined $string ) {
die "Error: must define both 'word' and 'string'.";
}
# Get the results, and display them (in the subroutine).
my $found = find_words_in_string( $string, @words );
return $found ? 0 : 1; # errorlevel is basically reverse of the truth :)
}
=head2 find_word_in_string
Given a string and one or more words, see if each word is in the string.
Returns true if all were found, false if not.
=cut
sub find_words_in_string($@) {
my ($string, @words) = @_;
print "Searching [$string]\n";
my $rc = 0; # default to failure
# Planning this out, I think I can do this with a regex. Just add ".*" between each character of $word, then search.
# Wrap that in a loop for each word, and we're good.
my $prev_found = 1; # initially success
foreach my $w ( @words ) {
my @word = split //, $w;
my $search = join ".*", @word;
my $is_in = $string =~ /$search/i;
print " Searching for [$w]: " . ($is_in ? "" : "NOT ") . "found.\n";
if ( $prev_found ) {
if ( $is_in ) {
$rc = 1;
} else {
$rc = $prev_found = 0; # will return failure; however, continue searching for other words.
}
}
}
print "Returning [$rc] " . ($rc ? "ALL FOUND" : "NOT all found") . ".\n";
return $rc;
}
I posted the above (slightly different, as I updated it now for a post) in a comment here: https://voat.co/v/QRV/3745232/23235460
God bless and stay safe everyone!
view the rest of the comments →
23238615? ago
Non programmer engineer here.
Can you work your magic to create a program that serches through all of the newly unsealed indictments, as they are released, that generates a list of the people involved and their charges? This work be extremely helpful to mine for those golden nuggets we have been hoping for.
23239311? ago
Let's work on this together. Can you obtain for me several sample unsealed indictments? I'll then write some code to pull out names, and ensure it works on all the examples. That won't guarantee that it'll work on every one that's newly unsealed, of course, but it's a start.
Also, if there's a web site showing the ones that are unsealed, along with the date/time that they are unsealed, I can have it detect them in real-time and report on them.
Appreciate your help in grabbing the pointers, and I'll see what I can do.
23239864? ago
Example: https://www.justice.gov/file/1080281/download
Summary: through 2018 https://drive.g00gle.com/drive/folders/1KPh2ASFggwF1XVnVpDB3mtwvwlH71om6
Fix the g00gle
I think there is a website called pacer holding the actual content.
I'll keep looking
23256849? ago
Thanks!!! I'm working on the web version and then I'll add requested features ("reverse"; and, "continue" i.e. start looking for second word after last character of first word's position, rather than starting over; and, show all analyses in one output).
Then I'll look at this. I'm somewhat "broken" and not checking replies although I perhaps should end that protective behavior soon. I have this post open in a separate tab and am coming back and checking it. Anyway I'm sorry about my condition which makes communicating with me more difficult but I'm trying to be here as a resource to help others. Weird, but anyway, I'll do what I can!
Actually, I've started "scratching this itch" and I'm working on this, now. :) But anyway, will report progress!
Well, I had to download Java to test a tool to extract the text (PDFBox), and that's gonna take 40 minutes longer so I'll switch gears, and return to this later.
23260537? ago
Thanks- I don't understand all that, but its great you are doing all you can to help the group track unsealed indictments.
23261872? ago
FYI, here's the post: https://voat.co/v/QRV/3748578