-
-
07 Oct 2015 20:34:06 UTC
- Distribution: Cache-Reddit
- Module version: 0.04
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (969 / 0 / 0)
- Kwalitee
Bus factor: 1- % Coverage
- License: freebsd
- Activity
24 month- Tools
- Download (4.58KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Cache::Reddit - a caching API that uses Reddit as the backend
VERSION
version 0.04
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
DESCRIPTION
Cache::Reddit is a module for cacheing your application data on Reddit. Data is serialized using Storable 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,
tr/01/ \t/g
) 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:
reddit_username - the reddit username to login with
reddit_password - the reddit password to login with
reddit_subreddit - the target subreddit to post data to
EXPORTED FUNCTIONS
set($dataref)
Serializes and saves the data in the subreddit as a text post. Returns the key for cached entry;
get ($key)
Deserializes and returns the cached entry.
remove ($key)
Deletes the item from the subreddit.
AUTHOR
David Farrell <dfarrell@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2015 by David Farrell.
This is free software, licensed under:
The (two-clause) FreeBSD License
Module Install Instructions
To install Cache::Reddit, copy and paste the appropriate command in to your terminal.
cpanm Cache::Reddit
perl -MCPAN -e shell install Cache::Reddit
For more information on module installation, please visit the detailed CPAN module installation guide.