Skip to content

Instantly share code, notes, and snippets.

@tardisx
tardisx / mastodon_scraper.pl
Last active January 4, 2018 01:34
Scrape mastodon timelines to create a list of mastodon instances.
#!/usr/bin/env perl
# Generate a list of mastodon instances by scraping the timeline and finding toots from
# other federated instances.
# Mojolicious non-blocking HTTP FTW!
# Now with 100% more self-modifying!
use strict;

Keybase proof

I hereby claim:

  • I am tardisx on github.
  • I am tardisx (https://keybase.io/tardisx) on keybase.
  • I have a public key ASCmGYh7R25QZnM33NdS8AmO5yPsnqeKUmctON9vQJjtcQo

To claim this, I am signing this object:

@tardisx
tardisx / MojoWiki
Created June 15, 2017 04:41
< 200 line, single-file wiki implementation in Mojolicious::Lite
#!/usr/bin/env perl
use Mojolicious::Lite;
use Mojo::Pg;
use Mojo::Pg::Migrations;
use Text::Markdown qw/markdown/;
my $wiki_link = qr{\b[A-Z][a-z]+[A-Z][A-Za-z]+\b};
helper pg => sub { state $pg = Mojo::Pg->new('postgresql://localhost/wiki') };
#!/usr/bin/env perl6
use v6;
my $files_path = ($*PROGRAM_NAME.IO.dirname.IO ~ '/../files').IO;
chdir $files_path || die "could not chdir to $files_path";
sub MAIN ($dir = '.') {
my @todo = $dir.IO;
my @files;
#!/usr/bin/env perl
=pod
Using Mojolicious and L<MCE> for forked independant workers,
communicating via L<MCE::Queue>.
Run this with C<./mce_mojolicious.pl daemon>, then visit C<http://localhost:3000>.
There are 4 queues: