https://github.com/dnmfarrell/cache-reddit
https://github.com/dnmfarrell/cache-reddit
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dnmfarrell/cache-reddit
- Owner: dnmfarrell
- License: other
- Created: 2015-05-02T02:01:50.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-10-07T20:34:18.000Z (over 10 years ago)
- Last Synced: 2025-01-16T16:49:26.004Z (over 1 year ago)
- Language: Perl
- Size: 99.6 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.pod
- License: LICENSE
Awesome Lists containing this project
README
=pod
=encoding UTF-8
=head1 NAME
Cache::Reddit - a caching API that uses Reddit as the backend
=head1 VERSION
version 0.04
=head1 SYNOPSIS
use Cache::Reddit;
my $id = set($data_ref); # serialize data and post to subreddit
my $data = get($id); # retrieve the data back
remove($id); # delete the data from Reddit
=head1 DESCRIPTION
Cache::Reddit is a module for cacheing your application data on Reddit.
Data is serialized using L and posted to a subreddit. The data
is posted as a text post, and the title of the post set to Cache::Reddit::
+ a random number.
The text is bleached before posting (converted to binary, C)
so it appears as whitespace on Reddit.
Due to the list-like search function, data retrieval performs at 0(n). However
deletion and insertion performs at 0(1).
It requires three environment variables to be set:
=over 4
=item * reddit_username - the reddit username to login with
=item * reddit_password - the reddit password to login with
=item * reddit_subreddit - the target subreddit to post data to
=back
=head1 EXPORTED FUNCTIONS
=head2 set($dataref)
Serializes and saves the data in the subreddit as a text post.
Returns the key for cached entry;
=head2 get ($key)
Deserializes and returns the cached entry.
=head2 remove ($key)
Deletes the item from the subreddit.
=head1 AUTHOR
David Farrell
=head1 COPYRIGHT AND LICENSE
This software is Copyright (c) 2015 by David Farrell.
This is free software, licensed under:
The (two-clause) FreeBSD License
=cut