Dist::...witter(3pm)
β¨ Dist::Zilla::Plugin::Twitter π β the manual page, bestie edition
okay so you're holding the manpage for Dist::Zilla::Plugin::Twitter (that's the <pink>Dist::...witter(3pm)</pink> joint, if you're reading it in your terminal). It's a Perl module, it lives in the User Contributed Perl Documentation section, and it does exactly one chaotic-iconic thing: it tweets when you release with Dist::Zilla. π¦β¨
π VERSION
version 0.026 β that's the one, bestie. π
πΈ SYNOPSIS
drop this in your dist.ini and watch the magic happen:
[Twitter]
hash_tags = #foo
url_shortener = TinyURL
π¦ DESCRIPTION
This plugin uses Net::Twitter to yeet a release notice over to Twitter. By default it'll include a link to your release on <http://metacpan.org>. lowkey iconic behavior.
The default configuration is giving exactly this:
[Twitter]
tweet_url = https://metacpan.org/release/{{$AUTHOR_UC}}/{{$DIST}}-{{$VERSION}}/
tweet = Released {{$DIST}}-{{$VERSION}}{{$TRIAL}} {{$URL}} !META{resources}{repository}{web}
url_shortener = TinyURL
The tweet_url gets shortened with WWW::Shorten::TinyURL, or literally whatever other service you pick β and if you use 'none' it just keeps the full URL, in which case Twitter shortens it for you instead. Then it gets appended to the tweet message. slay. π
π VARIABLE INTERPOLATION
These are the variables you can substitute into your URL and message templates:
DIST # Foo-Bar
MODULE # Foo::Bar
ABSTRACT # Foo-Bar is a module that FooBars
VERSION # 1.23
TRIAL # -TRIAL if is_trial, empty string otherwise.
TARBALL # Foo-Bar-1.23.tar.gz
AUTHOR_UC # JOHNDOE
AUTHOR_LC # johndoe
AUTHOR_PATH # J/JO/JOHNDOE
URL # http://tinyurl.com/...
β DISTMETA INTERPOLATION
So the resources info that lives in the META.* files of your distribution? You can reach it with "<META{key}{subkey}[1]>". Mix-and-match {...} to grab hashref elements and [\d] to grab arrayref elements, fr fr. You are personally responsible for making sure you're hitting the right part of the META data structure and treating it like the right type of data. Go read CPAN::Meta::Spec and especially the "$TYPE DATA" sections of CPAN::Meta. no cap, do the reading. π
The META{...} replacement can also take one of two modifiers, prefixed directly before META:
!β URL shortening β drop an exclamation point in there (!META{...}) and it URL-shortens the value you pulled out of the distmeta data structure. This does absolutely nothing unless that value is a URL to begin with. π@β Arrayref stringification β an at-symbol (@META{...}) makes it include every element of the arrayref you specify, joining them with$". So it's literally just like doing@{ $your_array_ref }. π«Ά
So for example, if you wanna use the GitHub home of the project instead of its metacpan page, you can do:
[Twitter]
tweet = Released {{$DIST}}-{{$VERSION}}{{$TRIAL}} !META{resource}{repository}{web}
url_shortener = TinyURL
Or, to include the authors in your tweet:
[Twitter]
tweet = @META{author} released {{$MODULE}} {{$VERSION}}: {{$URL}}
π§ PAUSEID
For this plugin to figure out your PAUSEID, you must be using the UploadToCPAN or FakeRelease plugin. that's the whole vibe check, bestie.
π HASHTAGS
You can use the hash_tags option to append hash tags β or honestly anything you want β to the end of the message generated from tweet. β¨
[Twitter]
hash_tags = #perl #cpan #foo
π AVAILABILITY
The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Go visit <http://www.perl.com/CPAN/> to find a CPAN site near you, or peek at <https://metacpan.org/module/Dist::Zilla::Plugin::Twitter/>. π
π SOURCE
The development version is on github at <http://github.com/dagolden/dist-zilla-plugin-twitter> and may be cloned from <git://github.com/dagolden/dist-zilla-plugin-twitter.git>. go forth and git clone, main character. π₯
π BUGS AND LIMITATIONS
You can make new bug reports and view existing ones through the web interface at <https://github.com/dagolden/dist-zilla-plugin-twitter/issues>. please actually report them, not just complain in the group chat π
πΈ AUTHORS
- David Golden <dagolden@cpan.org>
- Mike Doherty <doherty@cpan.org>
π COPYRIGHT AND LICENSE
This software is Copyright (c) 2014 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
and that's the whole page, bestie π no notes.
tiny sign-off moment: this whole thing is <cyan>perl v5.34.0</cyan>, dated <cyan>2022-06-13</cyan> β that's your footer info, and yes, the page title up top and that footer down here are the two things I folded into the vibe instead of copy-pasting them raw. iykyk. π¦β¨
π¦ where this page comes from
- debian bookworm: libdist-zilla-plugin-twitter-perl 0.026-3 Β· Apache-2.0
- debian trixie: libdist-zilla-plugin-twitter-perl 0.026-3 Β· Apache-2.0
- ubuntu noble: libdist-zilla-plugin-twitter-perl 0.026-3 Β· Apache-2.0
- ubuntu resolute: libdist-zilla-plugin-twitter-perl 0.026-3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms