package LANraragi::Plugin::Metadata::MyNewPlugin;
# Plugins can freely use all Perl packages already installed on the system
# Try however to restrain yourself to the ones already installed for LRR (see tools/cpanfile) to avoid extra installations by the end-user.
# You can also use LRR packages when fitting.
# All packages are fair game, but only functions explicitly exported by the Utils packages are supported between versions.
# Everything else is considered internal API and can be broken/renamed between versions.
use LANraragi::Model::Plugins;
use LANraragi::Utils::Logging qw(get_logger);
#Meta-information about your plugin.
name => "Plugin Boilerplate",
namespace => "dummyplug",
#login_from => "dummylogin",
description => "This is base boilerplate for writing LRR plugins.",
icon => "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBI\nWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4wYDFCYzptBwXAAAAB1pVFh0Q29tbWVudAAAAAAAQ3Jl\nYXRlZCB3aXRoIEdJTVBkLmUHAAAAjUlEQVQ4y82UwQ7AIAhDqeH/f7k7kRgmiozDPKppyisAkpTG\nM6T5vAQBCIAeQQBCUkiWRTV68KJZ1FuG5vY/oazYGdcWh7diy1Bml5We1yiMW4dmQr+W65mPjFjU\n5PMg2P9jKKvUdxWMU8neqYUW4cBpffnxi8TsXk/Qs8GkGGaWhmes1ZmNmr8kuMPwAJzzZSoHwxbF\nAAAAAElFTkSuQmCC",
#If your plugin uses/needs custom arguments, input their name here.
#This name will be displayed in plugin configuration next to an input box for global arguments, and in archive edition for one-shot arguments.
oneshot_arg => "This is a one-shot argument that can be entered by the user when executing this plugin on a file",
{type => "bool", desc => "Enable the DOOMSDAY DEVICE"},
{type => "int", desc => "Number of iterations", default_value => "9001"}
#Mandatory function to be implemented by your plugin
my $lrr_info = shift; # Global info hash, contains various metadata provided by LRR
my ($doomsday, $iterations) = @_; # Plugin parameters
if ($lrr_info->{oneshot_param}) {
return ( error => "Yaaaaaaaaa gomen gomen the oneshot argument isn't implemented -- You entered ".$lrr_info->{oneshot_param}.", right ?");
#Use the logger to output status - they'll be passed to a specialized logfile and written to STDOUT.
my $logger = get_logger("My Cool Plugin","plugins");
return ( error => "You fools! You've messed with the natural order!");
#Work your magic here - You can create subroutines below to organize the code better
$logger->info("Gettin' tags");
my $newtags = get_tags_from_somewhere($iterations); #To be implemented
#Something went wrong? Return an error.
return ( error => "Error Text Here");
#Otherwise, return the tags you've harvested.
return ( tags => $newtags );
sub get_tags_from_somewhere {
my $logger = get_logger("My Cool Plugin","plugins");
$logger->info("I'm supposed to be iterating $iterations times but I don't give a damn my man");
#Tags are expected to be submitted as a single string, containing tags split up by commas. Namespaces are optional.
return "my:new, tags:here, look ma no namespace";