view release on metacpan or search on metacpan
lib/Bluesky.pm view on Meta::CPAN
my $post = $self->getPost($url);
$url = $post->{viewer}{repost} // return;
}
$self->at->delete_record( 'app.bsky.feed.repost', $url->rkey );
}
method uploadBlob( $data, %opts ) { $self->at->upload_blob( $data, $opts{mime_type} // () ) }
method createPost(%args) {
# TODO:
# - recordWithMedia embed
lib/Bluesky.pm view on Meta::CPAN
$post{reply} = $self->getReplyRefs( $args{reply_to} ) if defined $args{reply_to};
# embeds
if ( defined $args{embed} ) {
if ( defined $args{embed}{images} ) {
$post{embed} = $self->uploadImages( @{ $args{embed}{images} } );
}
elsif ( defined $args{embed}{video} ) {
$post{embed} = $self->uploadVideo( $args{embed}{video} );
}
elsif ( defined $args{embed}{url} ) {
$post{embed} = $self->fetch_embed_url_card( $args{embed}{url} );
}
elsif ( defined $args{embed}{ref} ) {
lib/Bluesky.pm view on Meta::CPAN
$res ||= $parent; # escape hatch
}
{ root => { uri => $root->{uri}, cid => $root->{cid} }, parent => { uri => $parent->{uri}, cid => $parent->{cid} } };
}
method uploadFile( $bytes, $mime_type //= undef ) {
if ( builtin::blessed $bytes ) { $bytes = $bytes->slurp_raw }
elsif ( ( $^O eq 'MSWin32' ? $bytes !~ m/[\x00<>:"\/\\|?*]/ : 1 ) && -e $bytes ) {
$bytes = path($bytes)->slurp_raw;
}
lib/Bluesky.pm view on Meta::CPAN
$bytes =~ /^data:image\/svg\+xml;/ ? 'image/svg+xml' :
$bytes =~ /^.{4}ftypqt / ? 'video/quicktime' :
$bytes =~ /^.{4}ftyp(isom|mp4[12]?|MSNV|M4[v|a]|f4v)/i ? 'video/mp4' :
'application/octet-stream' );
my $at_http = $self->at->http;
my $url = sprintf( '%s/xrpc/%s', $self->at->host, 'com.atproto.repo.uploadBlob' );
my %headers = ( 'Content-Type' => $determined_mime, ( $at_http->auth ? ( 'Authorization' => $at_http->auth ) : () ), );
$headers{DPoP} = $at_http->_generate_dpop_proof( $url, 'POST' ) if $at_http->token_type eq 'DPoP';
state $http //= HTTP::Tiny->new;
my $res = $http->post( $url, { content => $bytes, headers => \%headers } );
my $content = $res->{content};
lib/Bluesky.pm view on Meta::CPAN
$msg .= ': ' . $json->{message} if $json->{message};
}
return At::Error->new( message => $msg, fatal => 1 );
}
method uploadImages(@images) {
my @ret;
for my $img (@images) {
my $alt = '';
my $mime = ();
if ( ( builtin::reftype($img) // '' ) eq 'HASH' ) {
lib/Bluesky.pm view on Meta::CPAN
}
else {
At::Error->new( message => 'image file size too large. 1000000 bytes maximum, got: ' . length $img )->throw
if length $img > 1000000;
}
my $blob = $self->uploadFile( $img, $mime );
$blob || $blob->throw;
push @ret, { alt => $alt, image => $blob };
}
{ '$type' => 'app.bsky.embed.images', images => \@ret };
}
method uploadVideoCaption( $lang, $caption ) {
if ( builtin::blessed $caption ) {
At::Error->new( message => 'caption file size too large. 20000 bytes maximum, got: ' . $caption->size )->throw
if $caption->size > 20000;
$caption = $caption->slurp_raw;
}
lib/Bluesky.pm view on Meta::CPAN
}
else {
At::Error->new( message => 'cation file size too large. 20000 bytes maximum, got: ' . length $caption )->throw
if length $caption > 20000;
}
my $blob = $self->uploadFile( $caption, 'text/vtt' );
$blob || $blob->throw;
{ '$type' => 'app.bsky.embed.video#caption', lang => $lang, file => $blob };
}
method uploadVideo($vid) {
my @ret;
my ( $alt, $mime, $aspectRatio );
my @captions;
if ( ( builtin::reftype($vid) // '' ) eq 'HASH' ) {
$alt = $vid->{alt};
$mime = $vid->{mime} // ();
$aspectRatio = $vid->{aspectRatio};
@captions = map { { lang => $_, file => $self->uploadFile( $vid->{captions}{$_}, 'text/vtt' ) } } keys %{ $vid->{captions} };
$vid = $vid->{video};
}
if ( builtin::blessed $vid ) {
At::Error->new( message => 'video file size too large. 50000000 bytes maximum, got: ' . $vid->size )->throw if $vid->size > 50000000;
$vid = $vid->slurp_raw;
lib/Bluesky.pm view on Meta::CPAN
}
else {
At::Error->new( message => 'video file size too large. 50000000 bytes maximum, got: ' . length $vid )->throw
if length $vid > 50000000;
}
my $blob = $self->uploadFile( $vid, $mime );
$blob || return $blob->throw;
return {
'$type' => 'app.bsky.embed.video',
video => $blob,
( @captions ? ( captions => \@captions ) : () ), ( defined $alt ? ( alt => $alt ) : () ),
lib/Bluesky.pm view on Meta::CPAN
( $card{title} ) = $res->{content} =~ m[<title>(.*?)</title>.*</head>]is;
( $card{description} ) = ( $res->{content} =~ m[<meta name="description" content="(.*?)".+</meta>.*</head>]is ) // '';
my ($image) = $res->{content} =~ m[<img.*?src="([^"]*)"[^>]*>(?:</img>)?]isp;
if ( defined $image ) {
if ( $image =~ /^data:/ ) {
$card{thumb} = $self->uploadFile($image);
}
else {
$res = $http->get( URI->new_abs( $image, $url ) );
$card{thumb} = $res->{success} ? $self->uploadFile( $res->{content}, $res->{headers}{'content-type'} ) : ();
}
}
}
{ '$type' => 'app.bsky.embed.external', external => \%card };
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Book/Chinese/MasterPerlToday/Catalyst.pod view on Meta::CPAN
prepare_cookies
prepare_path
prepare_body (unless parse_on_demand)
prepare_body_parameters
prepare_parameters
prepare_uploads
prepare_action
dispatch
finalize
finalize_uploads
finalize_error (if one happened)
finalize_headers
finalize_cookies
finalize_body
view all matches for this distribution
view release on metacpan or search on metacpan
}
#______________________________________________________________________________________________________________
#<link rel="stylesheet" href="http://search.cpan.org/s/style.css" type="text/css">
#<link rel="alternate" type="application/rss+xml" title="RSS 1.0" href="http://search.cpan.org/uploads.rdf">
1;
__END__
=head1 NAME
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/BasicBot/Pluggable/Module/RSS.pm view on Meta::CPAN
Version 0.02
=head1 SYNOPSIS
!load RSS
rss add http://search.cpan.org/uploads.rdf
rss list
rss remove http://search.cpan.org/uploads.rdf
=head1 DESCRIPTION
This module enables your bot to monitor various RSS feeds for new
headlines and post these to your channels. Every channel has it's
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/BasicBot/Pluggable/Module/TwitterFriendsStatus.pm view on Meta::CPAN
=head1 ACKNOWLEDGEMENTS
Thanks to Larry Wall for Perl, Randal Schwartz for my initial and on-
going Perl education, Damian Conway for mental inspiration, Sam Tregar for
teaching me how to write and upload CPAN modules, and the monks of PerlMonks
for putting up with my foolishness.
=head1 COPYRIGHT AND LICENSE
Copyright (c) 2008, Gryphon Shafer E<lt>gryphon@cpan.orgE<gt>.
view all matches for this distribution
view release on metacpan or search on metacpan
---------------------
Paste Via Form Upload
---------------------
Add a standard "Browse" button and filename field, and let people
upload via the form.
Also let people download verbatim with a link/button, to circumvent
crappy HTML renderers.
---------------
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Brackup/Backup.pm view on Meta::CPAN
my @gpg_rcpts = $self->{root}->gpg_rcpts;
my $n_kb = 0.0; # num: kb of all files in root
my $n_files = 0; # int: # of files in root
my $n_kb_done = 0.0; # num: kb of files already done with (uploaded or skipped)
# if we're pre-calculating the amount of data we'll
# actually need to upload, store it here.
my $n_files_up = 0;
my $n_kb_up = 0.0;
my $n_kb_up_need = 0.0; # by default, not calculated/used.
my $n_files_done = 0; # int
lib/Brackup/Backup.pm view on Meta::CPAN
}
$n_kb_up_need += $pc->length / 1024;
$pc->forget_chunkref;
}
}
warn "kb need to upload = $n_kb_up_need\n";
$stats->timestamp('Calc Needed');
}
my $chunk_iterator = Brackup::ChunkIterator->new(@files);
lib/Brackup/Backup.pm view on Meta::CPAN
$n_kb_done += $cur_file->size / 1024;
$cur_file = undef;
};
my $show_status = sub {
# use either size of files in normal case, or if we pre-calculated
# the size-to-upload (by looking in inventory, then we'll show the
# more accurate percentage)
my $percdone = 100 * ($n_kb_up_need ?
($n_kb_up / $n_kb_up_need) :
($n_kb_done / $n_kb));
my $mb_remain = ($n_kb_up_need ?
view all matches for this distribution
view release on metacpan or search on metacpan
This will:
1. Run all tests
2. Create the distribution tarball
3. Provide instructions for CPAN upload
For CPAN upload, you'll need:
- A PAUSE account (https://pause.perl.org/)
- CPAN::Uploader installed (`cpanm CPAN::Uploader`)
- PAUSE credentials in `~/.pause`
view all matches for this distribution
view release on metacpan or search on metacpan
0.07 2009-02-18
- Work with new MooseX::Params::Validate
- Specify MX::P::Validate version number in Makefile.PL
0.06 2008-11-03
- Forgot to update MANIFEST before uploading to CPAN.
0.05 2008-11-03
- Applied immutablity to classes where applicable, and vigorously
unimport Moose keywords when they are no longer needed. This results in
x 2 performance as far as defining a Bread::Board model (Daisuke Maki).
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Brick/Files.pm view on Meta::CPAN
## File::MMagic returns the illegal "application/msword" for all
## microsoft junk.
## We map this to either application/x-msword (default)
## or application/vnd.ms-excel, depending on the extension
my( $uploaded_ext ) = $file =~ m/\.(\w*)?$/g;
if( $format eq "application/msword" ) {
no warnings 'uninitialized';
$format = ($uploaded_ext =~ /^xl[st]$/)
?
"application/vnd.ms-excel"
:
"application/x-msword";
}
lib/Brick/Files.pm view on Meta::CPAN
$q->UNIVERSAL::can('param') or
die 'valid_file_clamav_clean: data object missing param() method';
my $field = $dfv->get_current_constraint_field;
my $img = $q->upload($field);
if (not $img and my $err = $q->cgi_error) {
warn $err;
return undef;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Brightcove/MAPI.pm view on Meta::CPAN
Wrapper for the write media api
=head2 $mapi->post($mapi_method, \%params, $file_name)
Wrapper for the write media api with file upload
=head1 SEE ALSO
=head2 Brightcove Media API Reference
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Broadworks/OCIP/Methods.pm view on Meta::CPAN
return $self->send_command(
'UserAccessDeviceFileModifyRequest',
userId => $x0,
accessDevice => [ deviceLevel => $x1, deviceName => $x2 ],
fileFormat => $x3,
uploadFile => $x4
);
}
# ----------------------------------------------------------------------
method UserAccessDeviceResetRequest ($x0, $x1, $x2) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Brownie/Session.pm view on Meta::CPAN
$session->unselect($locator);
=item * C<attach_file($locator, $filename)>
Sets a path to file upload field.
$session->attach_file($locator, $filename);
=back
view all matches for this distribution
view release on metacpan or search on metacpan
0.14 2016-09-06 (PERLANCAR)
- No functional changes.
- Re-upload because accidentally deleted the release.
0.13 2016-04-18 (PERLANCAR)
- No functional changes.
view all matches for this distribution
view release on metacpan or search on metacpan
Revision history for Perl extension Bundle::CMap.
1.0.1 Wed Sep 13 2006
- uploaded to CPAN for use with the upcoming CMap version 1.0
0.16 Wed Sep 20 2006
- original version uploaded to CPAN for CMap version 0.16
view all matches for this distribution
view release on metacpan or search on metacpan
- auto-generate SIGNATURE
0.09 2014-04-24 rurban
- CPAN::Reporter 1.2011
0.08 2014-04-24 rurban (not uploaded)
- bump lots of versions for CPAN::Reporter to deal with new CPAN reqs
- switch from Crypt::SSLeay to LWP::Protocol::https with IO::Socket::SSL and Net::SSLeay
to support hostname verification
0.07 2011-10-24 rurban
0.02 2010-08-24 rurban
- remove duplicate =head1 CONTENTS
- added SIGNATURE
0.01 2010-08-24 rurban
- original version as uploaded to CPAN
view all matches for this distribution
view release on metacpan or search on metacpan
Interchange.pm view on Meta::CPAN
You will also need the appropriate DBD module, i.e. DBD::mysql to support
B<MySQL>.
=item Spreadsheet::ParseExcel
Allows upload of XLS spreadsheets in UI. IO::Scalar and OLE::Storage_Lite
are prerequisites.
=item Spreadsheet::WriteExcel
Allows creation of XLS spreadsheets for download in UI.
view all matches for this distribution
view release on metacpan or search on metacpan
InterchangeKitchenSink.pm view on Meta::CPAN
Needed for pre-fork mode of Interchange, prevents permanent write of configuration.
=item Spreadsheet::ParseExcel
Allows upload of XLS spreadsheets for database import in the UI.
=item Spreadsheet::WriteExcel
Allows output of XLS spreadsheets for database export in the UI.
view all matches for this distribution
view release on metacpan or search on metacpan
Revision history for Perl extension Bundle::Math::Approx.
1.00 Sat Apr 3 12:24:51 2004
- original version as uploaded to CPAN
view all matches for this distribution
view release on metacpan or search on metacpan
Revision history for Perl extension Bundle::Math::Base.
1.00 Sat Apr 3 12:24:51 2004
- original version as uploaded to CPAN
view all matches for this distribution
view release on metacpan or search on metacpan
Revision history for Perl extension Bundle::Math::Big.
1.00 Sat Apr 3 12:24:51 2004
- original version as uploaded to CPAN
view all matches for this distribution
view release on metacpan or search on metacpan
1.01 Tue Apr 13 18:55:42 2004
- Added Math::Symbolic::Custom::ErrorPropagation
1.00 Sat Apr 3 12:24:51 2004
- original version as uploaded to CPAN
view all matches for this distribution
view release on metacpan or search on metacpan
Revision history for Perl extension Bundle::Math::Expression.
1.00 Sat Apr 3 12:24:51 2004
- original version as uploaded to CPAN
view all matches for this distribution
view release on metacpan or search on metacpan
1.01 Mon Apr 19 11:04:22 2004
- Now including Finance::Calc::Performance
1.00 Sat Apr 3 12:24:51 2004
- original version as uploaded to CPAN
view all matches for this distribution
view release on metacpan or search on metacpan
Revision history for Perl extension Bundle::Math::Fractal.
1.00 Sat Apr 3 12:24:51 2004
- original version as uploaded to CPAN
view all matches for this distribution
view release on metacpan or search on metacpan
Revision history for Perl extension Bundle::Math::Geometry.
1.00 Sat Apr 3 12:24:51 2004
- original version as uploaded to CPAN
view all matches for this distribution
view release on metacpan or search on metacpan
Revision history for Perl extension Bundle::Math::Interface.
1.00 Sat Apr 3 12:24:51 2004
- original version as uploaded to CPAN
view all matches for this distribution
view release on metacpan or search on metacpan
1.01 Sun May 15 19:45:47 2004
- Removed Math::MatrixCplx because it is not availlable from CPAN.
1.00 Sat Apr 3 12:24:51 2004
- original version as uploaded to CPAN
view all matches for this distribution
view release on metacpan or search on metacpan
Revision history for Perl extension Bundle::Math::Numeric.
1.00 Sat Apr 3 12:24:51 2004
- original version as uploaded to CPAN
view all matches for this distribution
view release on metacpan or search on metacpan
Revision history for Perl extension Bundle::Math.
1.00 Sat Apr 3 12:24:51 2004
- original version as uploaded to CPAN
1.01 Sun Jun 13 17:48:12 2004
- Added Bundle::Math::Statistics
1.02 Fri Jan 21 15:00:44 2005
view all matches for this distribution