App-txtnix
view release on metacpan or search on metacpan
=item limit_timeline
Limit amount of tweets shown in your timeline. Defaults to 20.
=item timeout
Time a http request is allowed to take. Defaults to 5 seconds.
=item rewrite_urls
Rewrite urls you are following depending on their http response
code. Addresses that return 301 (moved permanently) are rewritten
to their new url. Return code 410 (gone) results in unfollowing that
address. Defaults to true. You get a warning if a url is rewritten.
=item embed_names
I<txtnix> expands the local names in your tweets to their urls. So I<@bob>
becomes I<@E<lt>http://example.com/twtxt.txtE<gt>>. With embed names you can
also share your local nickname with your followers. If this is set to true
mentions will be rewritten to I<@E<lt>bob http://example.com/twtxt.txtE<gt>>.
Defaults to true.
=item sorting
Order in which to sort the timeline. Can be either I<descending> or
I<ascending>. Defaults to I<descending>, so the newest tweets are on the top of
the timeline.
=item time_format
How to format dates in your timeline. This should be a strftime-like
format string. Defaults to I<%F %H:%M>.
=item pre_tweet_hook
Command to be executed before tweeting.
=item post_tweet_hook
Command to be executed after tweeting.
=item write_metadata
Write metadata about who you followed or unfollowed in your twtfile. The twtxt
file format does not specify any way to add metadata to your feed, so the
current implementation to use a text starting with I<//> is a properiaty
extension of txtnix. Use at your own risk. Defaults to false.
=item hide_metadata
Hide txtnix style metadata. Defaults to true.
=item use_colors
Use ANSI-colors for the I<pretty> layout. Defaults to true.
=item display_layout
In which format to display your timeline. I<txtnix> defines two different
layout: I<simple> is a line oriented very basic layout. I<pretty> looks
less dense and supports ANSI colors and text wrapping. Defaults to simple.
=item wrap_text
If to wrap text in pretty display. Defaults to true.
=back
=head2 followings
This section holds all your followings as nick, URL pairs. You can edit
this section manually or use the follow/unfollow commands of twtxt for
greater comfort.
=head2 colors
In I<pretty mode> mentions, hashtags, the nick and timestamp can be colorized
with ANSI colors. You can set either I<mention>, I<hashtag>, I<time> or
I<nick>:
[colors]
nick = blue on_magenta
time = grey09
hashtag = rgb515
mention =
Setting a value to an empty string will disable coloring for that element.
=head1 Hooks
I<pre_tweet_hook> and I<post_tweet_hook> are very useful if you want to
push your twtxt file to a remote server. The following examples are just
some ideas, basically the sky is the limit.
Transmit the the latest tweet via curl to an http endpoint:
post_tweet_hook = "tail -1 {twtfile} | curl -s -d @- -d 'name=foo' -d 'password=bar' http://example.com/feeds"
Publish your twtfile on aws s3:
post_tweet_hook = "aws s3 cp {twtfile} s3://mybucket.org/twtxt.txt --cache-control 'max-age=60,public'"
Update your git hosted twtfile before tweeting and push it afterwards:
pre_tweet_hook = "cd ~/git/website && git pull --rebase --prune"
post_tweet_hook = "cd ~/git/website && git commit -m tweet twtxt.txt && git push"
=head1 COPYRIGHT AND LICENSE
Copyright 2015 Mario Domgoergen C<< <mario@domgoergen.com> >>
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
( run in 0.957 second using v1.01-cache-2.11-cpan-b16cb0d3907 )