WWW::M...m::Date(3pm)

πŸ“¦
version 0.13 Β· 2 versions
  • 0.13 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.12 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

WWW::Mechanize::FormFiller::Value::Random::Date β€” bestie, this is the module that drops a randomly generated timestamp straight into an HTML form field. It's giving "I don't know my birthday so I'm letting the vibes decide" energy. ✨

This page lives in the User Contributed Perl Documentation section, and the manual name you'd see at the top is WWW::M...m::Date(3pm). πŸŽ€


🌸 SYNOPSIS 🌸

  use WWW::Mechanize::FormFiller;
  use WWW::Mechanize::FormFiller::Value::Random::Date;

  my $f = WWW::Mechanize::FormFiller->new();

  # Create a random value for the HTML field "born"

  my $born = WWW::Mechanize::FormFiller::Value::Random::Date->new(
    born => string => '%Y%m%d', min => '20000101', max => '20373112' );
  $f->add_value( born => $born );

  # Alternatively take the following shorthand, which adds the
  # field to the list as well :

  # If there is no password, put a random one out of the list there
  my $last_here = $f->add_filler( last_here => Random::Date => string => '%H%M%S', min => '000000', max => 'now');

okay so literally look at that second example πŸ’… β€” add_filler is the shorthand that also adds the field to the list, so you get the value and the registration in one go. Efficiency queen behavior. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

This class provides a way to write a randomly chosen value into a HTML field. That's the whole vibe: you point it at a field, you give it a strftime-ish format, and it manifests a timestamp out of thin air. πŸͺ„

✨ new NAME, %ARGS ✨

Creates a new value which will correspond to the HTML field "NAME". The allowed %ARGS are:

  • string => POSIX strftime string
  • min => minimum time stamp (inclusive)
  • max => maximum time stamp (exclusive)

The "min" and "max" time stamps must be in the same format as the "string" supplies. fr fr β€” if your string is '%Y%m%d' then your min and max gotta speak that same language, no mixing. πŸ—£οΈ

⚠️ WARNING ⚠️ The algorithm to implement "min" and "max" barriers is very simplicistic β€” it tries as many random values as necessary to meet the two criteria. This means that your script may enter an infinite loop if the criteria can never be attained or are too little apart. Not me watching your script spin forever because your min and max are two seconds apart 😭 keep those ranges roomy bestie.

🌈 name [NEWNAME] 🌈

Gets and sets the name of the HTML field this value corresponds to. Cute little getter/setter moment. πŸŽ€

πŸ’œ value FIELD πŸ’œ

Returns the value to put into the HTML field.


⭐ EXPORT ⭐

None by default. Nope, nothing gets exported, it's giving minimalist. 🧚


This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Copyright (C) 2002,2003 Max Maischein


🫢 AUTHOR 🫢

Max Maischein, <corion@cpan.org>

Please contact me if you find bugs or otherwise improve the module. More tests are also very welcome ! (yes bestie, tests are a love language πŸ’–)


πŸ”₯ SEE ALSO πŸ”₯

  • Data::Random
  • WWW::Mechanize
  • WWW::Mechanize::Shell
  • WWW::Mechanize::FormFiller
  • WWW::Mechanize::FormFiller::Value::Value
  • WWW::Mechanize::FormFiller::Value::Default
  • WWW::Mechanize::FormFiller::Value::Fixed
  • WWW::Mechanize::FormFiller::Value::Interactive

and that's a wrap on the page, bestie πŸ’… This manual ships with perl v5.34.0 and was last touched on 2022-08-20 β€” shoutout to the era that brought us this lil timestamp generator. 🌟 Go forth and fill forms randomly. Slay. πŸ’–

πŸ“¦ where this page comes from