1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut-pastebin synced 2025-06-07 14:17:26 -04:00

About to add collection

This commit is contained in:
Ryan Voots 2020-08-18 19:23:33 -04:00
parent d9a683e785
commit 9aaee15e2d
9 changed files with 110546 additions and 3 deletions

1
hypnotoad.pid Normal file
View file

@ -0,0 +1 @@
951231

View file

@ -81,6 +81,8 @@ sub api_post_paste {
$url =~ s|http:|https:|;
unless ($code =~ $words || $who =~ $words || $desc =~ $words || $c->paste->is_banned_ip($c->remote_addr)) {
$c->perlbot->announce($channel, $who, substr($desc, 0, 40), $url);
} else {
printf "Not doing announcement, [%s] [%s] [%s] [%s]\n", ($code =~ $words), ($who =~ $words), ($desc =~ $words), ($c->paste->is_banned_ip($c->remote_addr));
}
}
# }

View file

@ -82,6 +82,9 @@ sub get_paste {
my $row = $c->paste->get_paste($pasteid);
use Data::Dumper;
print Dumper($row);
if ($row) {
my $promise = Mojo::Promise->new(sub {
my $resolve = shift;

View file

@ -35,8 +35,8 @@ sub _get_cache {
return $memd->get($key);
}
my @major_langs = qw/perl perl5.30.0 perl5.28.2 perl5.26.3 perl5.24.4 perl5.22.4 perl5.20.3 perl5.18.4 perl5.16.3 perl5.14.4 perl5.12.5 perl5.10.1 perl5.8.9 perl5.6.2/;
my @full_langs = map {"perl$_"} '', qw/5.30.0 5.28.2 5.28.1 5.28.0 5.26.3 5.26.2 5.26.1 5.26.0 5.24.4 5.24.3 5.24.2 5.24.1 5.24.0 5.22.4 5.22.3 5.22.2 5.22.1 5.22.0 5.20.3 5.20.2 5.20.1 5.20.0 5.18.4 5.18.3 5.18.2 5.18.1 5.18.0 5.16.3 5.16.2 5.16.1 5.16.0 5.14.4 5.14.3 5.14.2 5.14.1 5.14.0 5.12.5 5.12.4 5.12.3 5.12.2 5.12.1 5.12.0 5.10.1 5.10.0 5.8.9 5.8.8 5.8.7 5.8.6 5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0 5.6.2 5.6.1 5.6.0/;
my @major_langs = qw/perl perl5.32.0 perl5.30.3 perl5.28.2 perl5.26.3 perl5.24.4 perl5.22.4 perl5.20.3 perl5.18.4 perl5.16.3 perl5.14.4 perl5.12.5 perl5.10.1 perl5.8.9 perl5.6.2/;
my @full_langs = map {"perl$_"} '', qw/5.32.0 5.30.3 5.30.2 5.30.1 5.30.0 5.28.2 5.28.1 5.28.0 5.26.3 5.26.2 5.26.1 5.26.0 5.24.4 5.24.3 5.24.2 5.24.1 5.24.0 5.22.4 5.22.3 5.22.2 5.22.1 5.22.0 5.20.3 5.20.2 5.20.1 5.20.0 5.18.4 5.18.3 5.18.2 5.18.1 5.18.0 5.16.3 5.16.2 5.16.1 5.16.0 5.14.4 5.14.3 5.14.2 5.14.1 5.14.0 5.12.5 5.12.4 5.12.3 5.12.2 5.12.1 5.12.0 5.10.1 5.10.0 5.8.9 5.8.8 5.8.7 5.8.6 5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0 5.6.2 5.6.1 5.6.0/;
sub get_eval {
my ($self, $paste_id, $code, $langs, $wait, $callback) = @_;

View file

@ -6,7 +6,7 @@ use warnings;
use Mojo::Base '-base';
my @langs = (
{name => "perl5.30", mode => "perl", description => "Perl 5.30"},
{name => "perl5.32", mode => "perl", description => "Perl 5.32"},
{name => "perl6", mode => "perl", description => "Rakudo Star / Perl 6"},
{name => "bash", mode => "bash", description => "Bash"},
{name => "ruby", mode => "ruby", description => "Ruby (2.1)"},
@ -22,6 +22,12 @@ my @langs = (
{name => "evaltall", mode => "perl", description => "Perl (EvalAll) (major threaded)"},
{name => "evalrall", mode => "perl", description => "Perl (EvalAll) (major un+threaded)"},
{name => "evalyall", mode => "perl", description => "Perl (EvalY'All) (EVERYTHING)"},
{name => "perl5.32.0", mode => "perl", description => "Perl 5.32.0"},
{name => "perl5.32.0t", mode => "perl", description => "Perl 5.32.0 (threaded)"},
{name => "perl5.30.3", mode => "perl", description => "Perl 5.30.3"},
{name => "perl5.30.3t", mode => "perl", description => "Perl 5.30.3 (threaded)"},
{name => "perl5.30.2", mode => "perl", description => "Perl 5.30.2"},
{name => "perl5.30.2t", mode => "perl", description => "Perl 5.30.2 (threaded)"},
{name => "perl5.30.1", mode => "perl", description => "Perl 5.30.1"},
{name => "perl5.30.1t", mode => "perl", description => "Perl 5.30.1 (threaded)"},
{name => "perl5.30.0", mode => "perl", description => "Perl 5.30.0"},

View file

@ -78,6 +78,7 @@ sub get_asn_for_ip {
sub is_banned_ip {
my ($self, $_ip) = @_;
return 0 if ($_ip =~ /:/); # ignore ipv6 stuff for now
my $ip = sprintf("%03d.%03d.%03d.%03d", split(/\./, $_ip));
my $asn = $self->get_asn_for_ip($ip);

1
public/mpf Symbolic link
View file

@ -0,0 +1 @@
/home/perlbotjail/mod_perl-faq/assets

110509
static/build-2017-10-09.log Normal file

File diff suppressed because it is too large Load diff

View file

@ -19,7 +19,27 @@
</head>
<body>
<center>Note from author: I would like to add a small amount of data gathering/analytics to this to collect some browser information. See the footer at the bottom of the page for details. <br></center>
[% PROCESS body %]
<div class="margins" style="margin: 5em 5em 5em 5em">
Now that I have more space without disrupting the page here's a full explanation of what I want to do and am planning:
<ul><li>I want to add some small analytics before doing an update, this will require javascript to collect the information</li>
<li>The javascript will not be required to use the site, ever.</li>
<li>I will be trying to collect only the following:
<ol><li>More detailed browser information (versions, names, etc.). I mostly get this through the webserver logs already but verfiying that it's accurate would be a plus</li>
<li>Screen size. This is really the big one. All of my screens are either 1440p, 4K or an ultrawide monitor. I know those aren't representative of those visiting the site so I want to have an idea of how small I should design for</li>
</ol>
<li>My plan is to self host a simple analytics system on the same server as perl.bot, no data will ever leave the my control. Nothing will be sold or shared to anyone, and ideally no cookies will be needed for this. (I can't promise on this one yet, as I haven't setup or selected that platform yet. The two I'm looking at right now are GoatCounter and Plausible, they are detailed here <a href="https://lwn.net/SubscriberLink/822568/04fe39890fe191af/">https://lwn.net/SubscriberLink/822568/04fe39890fe191af/</a>.</li>
<li>I will continue to explicitly support TUI browsers like lynx, elinks and the emacs web browser</li>
<li>This will not cause javascript to be needed for the site to function at all</li>
</ul>
<br>
The reason for this is that I want to finally get around to adding multiple file support to the web UI, (It's been partially supported via undocumented extensions to the API and the evalserver itself) and make the UI changes necessary for that to work sanely. I don't want those changes to cause anybody's experience to degrade and I'll also be using that time as a chance to clean up the HTML, JS, and CSS that does exist here to reduce page size a bit. Depending on how things go I may drop some of the tiny things I've got (a small poly fill for the syntax highlighting) for Internet Explorer too. Also please look forward to the next version of Mozilla Firefox as it finally, <b>*FINALLY*</b> fixes the long standing issue with Middle-Click paste on linux with the syntax highlighting editor. That's been the most complained about problem on the pastebin.
If you have any questions or concerns please get in touch with me on IRC (freenode or magnet, simcop2387) or email me simcop2387 @ simcop2387.info. Also now on reddit, <a href="https://www.reddit.com/r/perl/comments/hc4qea/ethical_data_collection_on_a_pastebin/">https://www.reddit.com/r/perl/comments/hc4qea/ethical_data_collection_on_a_pastebin/</a>
</div>
</body>
</html>