The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Text::Tweet - Optimize a tweet based on given keywords

VERSION

version 0.004

SYNOPSIS

use Text::Tweet;

my $tweeter = new Text::Tweet({
  maxlen => 140,
  marker => '#',
  hashtags_at_end => 0,
  keywords => [ 'Perl', 'Twitter', 'Facebook', 'Private' ],
});

my $tweet = $tweeter->make(
  'This is my Perl Twitter Facebook Tweet',
  \'http://some.url/'
);
# This is my #Perl #Twitter #Facebook Tweet http://some.url/ #private

my $next_tweet = $tweeter->make_without_keywords(
  'This is my Perl Twitter Facebook Tweet',
  \'http://some.url/',
  [ 'Tweet' ]
);
# This is my Perl Twitter Facebook #Tweet http://some.url/

my $other_tweeter = new Text::Tweet({
  hashtags_at_end => 1,
});

my $other_tweet = $other_tweeter->make(
  'This is my Perl Twitter Facebook Tweet',
  \'http://some.url/',
  [ 'Perl', 'Twitter', 'Facebook' ]
);
# This is my Perl Twitter Facebook Tweet http://some.url/ #perl #twitter #facebook

DESCRIPTION

This package is nothing more than a little helper for making a more optimized tweet. It is supposed to be part of some bigger application, for example for automatic Tweet generation out of RSS, or integrated via Ajax on a webpage to offer more effective tweets for the user.

CONTRIBUTORS

edenc - giving API design hints

AUTHOR

Torsten Raudssus <torsten@raudssus.de> http://www.raudssus.de/

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Raudssus Social Software.

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