API-Mathpix

 view release on metacpan or  search on metacpan

lib/API/Mathpix.pm  view on Meta::CPAN


=head1 EXPORT

A list of functions that can be exported.  You can delete this section
if you don't export anything, such as for a purely object-oriented module.

=head1 SUBROUTINES/METHODS

=cut

sub BUILD {
  my ($self) = @_;

  $self->_ua(
    LWP::UserAgent->new(
      timeout => 30,
    )
  );

  $self->_bucket(
    Algorithm::LeakyBucket->new(

lib/API/Mathpix.pm  view on Meta::CPAN

      seconds => 60
    )
  );

}

=head2 process

=cut

sub process {
  my ($self, $opt) = @_;


  if (-f $opt->{src}) {

    my $contents = do {
      open my $fh, $opt->{src} or die '...';
      local $/;
      <$fh>;
    };



( run in 0.370 second using v1.01-cache-2.11-cpan-a5abf4f5562 )