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!
23264382? ago
This submission was linked from this anonymous v/QRV comment.
Posted automatically (#102596) by the SearchVoat.co Cross-Link Bot. You can suppress these notifications by appending a forward-slash(/) to your Voat link. More information here.
23261874? ago
This submission was linked from this anonymous v/QRV submission.
Posted automatically (#102554) by the SearchVoat.co Cross-Link Bot. You can suppress these notifications by appending a forward-slash(/) to your Voat link. More information here.
23244159? ago
Damn impressive. I need to learn to code.
23256782? ago
Thanks anon, I agree! :) I can't give you any pointers for learning though as I "started from scratch" and there are far better ways to learn these days!!! Good luck and God bless.
23239696? ago
I love regex.
23256766? ago
It is one of the things "keeping me on" Perl!!! Python is neat but nowhere near as expressive as Perl can be wrt regexes. I've been exploring Go recently, very neat how it's so easy to make a function call "multi-CPU" just by adding "go " before it! (Of course you have to "write it right" to begin with but Go helps with that; also I love how Go "formats" your code so you don't have to!)
23256918? ago
I will check out go. I am a python man myself. Thanks for the info.
23238878? ago
Whoa, that's some serious work there anon. Good job!
23239240? ago
Thank you! God bless, I have a feeling the next couple weeks are going to trying times.
23238854? ago
Hey fren howd the cloves work out?
23239238? ago
Seems good so far. Did 1/day for 12 days, then 1/day of apricot seeds, and now 1/day of each. Well, sometimes 2 cloves if they shake out of the jar that way. :)
But not really noticing major changes. Thanks and appreciate you reaching out again, I had "saved" that convo but I save everything I write (so that I can data mine it for digits, at some future time) so searching would have taken forever.
(Then again -- you can point at this script and say "major change, perhaps?" and I might agree... :) )
23239945? ago
the only way for change is total diet change i understand completely. the problem is the little bugs have changed our RNA which altars the Dna so we have to fight this long term !!
or tend (the (garden) so balance is maintained. zinc and iron along w friends the b<'s which open up the cell wall and allow damage mitigation. just rem salt is your friend in all its forms iodine, sea salt, msm and the oils do not forget the oils.. bait them with sugar and dairy in small doses then kill with salt and oil !!!!!!!! fermented foods are a dubble whammy for the devil bugs
Keep vigilant and stay you!!
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
23261488? ago
Turns out I really don't like web development on a Mac! All the keystrokes are different depending on which IDE I'm using (Visual Studio Code, versus Komodo which I'm more familiar with) and it's making me really, REALLY slow.
That said -- I got somewhere, and will make a separate post about it. I'll copy the URL here as well, once I've done so.
You can go to http://digitsdigitsdigits.com/cipher.pl to play around with it. Very rudimentary interface but I've now gotten beyond the "make it run from behind a web server" so I can work on making it prettier/more functional (i.e., adding "in reverse"; "start next word from where previous word ended"; and "both of those" to the existing output).
Also I can "color" the output, to show which letters had actually matched.
Making the actual "grille cipher" as images overlayed on the Twitter images is likely something I don't have the skills for, but then someone else can pile on as well! :)
23237961? ago
If every letter in the alphabet is in a selected text, than would you be able to find any word? Just asking b/c coding and ciphers are not in my wheelhouse.
23239183? ago
With this algorithm, only if they're sequential. In other words:
If the search string is: "abcde", then:
Matches: "a" "b" "c" "d" "e" "ab" "ac" "ad" "ae" "bcd" "de"
Does not match: "ba" "abb" "ea"
Does that make sense?
23240688? ago
It makes more sense. One question- do certain words have to come before others or do you start at the beginning of the text again in order to get a message?
23256089? ago
This program always starts at the beginning. Someone else suggested a "reverse" option, and you're suggesting a "continue" option. Both are fairly simple to write, and also seem useful. In fact having it do all three analyses at once also seems helpful.
Currently I'm working on the web version to make it even easier to share. Then I'll do these features. Thanks!
23237239? ago
Wow ... I don't understand any of it it God Bless you for your work and understanding. 🙏❤️🤍💙
23237474? ago
Hashtag metoo lol. I see letters and numbers that resemble those of my native language but it might as well be Greek for all I can understand 😣😊
23237226? ago
I see a lot of effort and technical interest, but as a regular person I cannot find any relateable INFORMATION which leads to any conclusion regrading anything.
EXPLAIN please what the hell the purpose of this exercise is.
23237849? ago
To make it easier to data-mine Comey's tweets. And other tweets.
"Learn our comms" etc.
I bought NMBRFG a laptop for Christmas because he demonstrated that he had learned the gematria comms. This is a different form of comm.
See https://voat.co/v/QRV/3745232 for the reason I'm doing this.
23236565? ago
There's only one thing I hate more than reading Perl scripts. It's interacting with Perl programmers.
23237192? ago
as opposed to your usual VBAforHaskell community?
23237301? ago
Python, bitch. Come at me.
23237397? ago
lol....here's a sparse dataset i need analyzed (calculate the mean):
[...................../´¯/)
....................,/¯../
.................../..../
............./´¯/'...'/´¯¯`·¸
........../'/.../..../......./¨¯\
........('(...´...´.... ¯~/'...')
..........................'...../
..........''............. _.·´
..........................(
..............................]
23238907? ago
Dude you could of just wrote this JL. < much quicker.
23238309? ago
58
23236480? ago
This submission was linked from this anonymous v/QRV comment.
Posted automatically (#102022) by the SearchVoat.co Cross-Link Bot. You can suppress these notifications by appending a forward-slash(/) to your Voat link. More information here.
23236454? ago
Can someone run this on 1000 other tweets to see if it hits, or duds? If only 1 in 1000 hits that would be interesting
23242295? ago
Maybe this is what's with the dogs - sign in the window - message here!
23236899? ago
This was my first thought. We know the original tweet is possibly a true hit, but we need to work out whether it was a coincidence or not.
23237791? ago
Yes, I'm making a tool available so that doing it 1,000 times will be significantly less effort.
23236348? ago
Don’t really care for the content but great job,I wasn’t sure if anyone on this website had half a brain.
23236128? ago
Perl so disgusting
23236032? ago
Well done OP.
23235995? ago
Great job anon
23235961? ago
Sorry, only do html, this is over my head.
23235769? ago
Honestly anon I have more knowledge of coding than most who have haven't formally studied it. This is something I can do but you're way over everyone's head with this. Maybe a 1 minute vid showing your screen from the moment it is copied off the post until you finish running it with alternate text?
23236328? ago
I realize this isn't for everyone. I'll write up a short tutorial (eating right now).
23236740? ago
To use this:
I think I will actually work on putting this on a web page. Be back in a bit.
23252076? ago
non-programmer here. what is the input? command and parameters? a text file of the tweet to be checked? same directory?
example: find_word.py textfile
23256049? ago
Input is on the command line:
perl find-words.pl --text="The text to search through" --word=a --word=b --word=c
As I was writing it, I realized that was a bit too much to type so I had it take in "naked args" as words as well, so the above could be written more easily as:
perl find-words.pl --text="The text to search through" a b c
I'm working on the web version and got to a point where I think I can make it over that hill, last night. Haven't looked at it yet today, slept 12 hours which was awesome (Rick Simpson Oil ftw!).
23258099? ago
LOL...#1. Thanks for all the work, don't knock yourself out, I think we may see some signs of light by Easter. #2. I hear you on the Rick Simpson oil, and chocolates, and gummies, and mints, and infused honey. lol
23264392? ago
Oh shit - my company I work in the lab for makes infused honey, very few others in MA doing that as well
23265522? ago
It doesn't get more natural than that, two gifts from nature to man. Good luck and God bless!
23237768? ago
Okay, I am still recovering from multiple concussions, and putting this into a web page has defeated me. Maybe later, my apologies.
23242281? ago
Does it only identify words in sequence (or reverse), so Kennedy , k then e then n then n etc in order from the text, otherwise any word can be made from 26 letters depending on your rules for dubs, trips etc.
23256011? ago
That is correct, it identifies them in sequence (and not in reverse, although I suppose I could add that fairly easily).
23237929? ago
No worries thanks for the perl anyway.
23235745? ago
Ugh I despise Perl.
23236706? ago
That's okay; WAHOR, and this is something I am (was) strong at.
23235918? ago
It rips script like few others though.
23236602? ago
Yes, it is good at what it does.
Still hate it. :)
23237132? ago
A great interpretive language to have in one's toolbox. I didn't need it often, but when I did, it was so much faster than writing a script in any other language to do the same. I changed careers long ago ... and I still miss writing applications. I enjoyed that work.
23235685? ago
This submission was linked from this anonymous v/QRV comment.
Posted automatically (#102009) by the SearchVoat.co Cross-Link Bot. You can suppress these notifications by appending a forward-slash(/) to your Voat link. More information here.