NAME
Net::Digg - Quickly consume and interface with the Digg API.
SYNOPSIS
use Net::Digg;
my $digg = Net::Digg->new();
# Print the user that submitted the latest upcoming story.
my $result = $digg->get_upcoming_stories();
print $result->{ 'stories' }[0]->{'title'};
# Print the titles of the twenty latest popular stories
my %params = ('count' => 20);
$result = $digg->get_popular_stories(\%params);
my $stories = $result->{'stories'};
foreach $story (@$stories) {
print $story->{'title'} . "\n";
}
See also FUNCTIONS, DESCRIPTION, and EXAMPLES below.
INSTALLATION
The typical:
FUNCTIONS
new()
Creates the Digg object.
get_stories (\%params)
Given
Get all stories.
get_popular_stories (\%params)
Given
Get all popular stories.
get_upcoming_stories (\%params)
Given
Get all popular stories.
get_top_stories (\%params)
Given
Get top stories.
get_hot_stories (\%params)
Given
Get hot stories.
get_stories_by_container ($container, \%params)
Given
Get all stories from a given container.
get_popular_stories_by_container ($container, \%params)
Given
Get all popular stories from a given container.
get_upcoming_stories_by_container ($container, \%params)
Given
Get all upcoming stories from a given container.
get_top_stories_by_container ($container, \%params)
Given
Get top stories from a given container.
get_hot_stories_by_container ($container, \%params)
Given
Get hot stories from a given container.
get_stories_by_topic ($topic, \%params)
Given
Get all stories from a given topic.
get_popular_stories_by_topic ($topic, \%params)
Given
Get all popular stories from a given topic.
get_upcoming_stories_by_topic ($topic, \%params)
Given
Get all upcoming stories from a given topic.
get_top_stories_by_topic ($topic, \%params)
Given
Get top stories from a given topic.
get_hot_stories_by_topic ($topic, \%params)
Given
Get hot stories from a given topic.
get_story_by_id ($id, \%params)
Given
Get identified story.
get_stories_by_ids (@ids, \%params)
Given
Get a list of stories with the given ids.
get_story_by_title ($title, \%params)
Given
Get identified story.
get_stories_by_user ($user, \%params)
Given
Get stories submitted by given user.
get_popular_stories_by_user ($user, \%params)
Given
Get popular stories submitted by given user.
get_upcoming_stories_by_user ($user, \%params)
Given
Get upcoming stories submitted by given user.
get_stories_dugg_by_user ($user, \%params)
Given
Get stories dugg by given user.
get_stories_commented_by_user ($user, \%params)
Given
Get stories commented by given user.
get_stories_by_friends ($user, \%params)
Given
Get stories submitted by given user friends.
get_popular_stories_by_friends ($user, \%params)
Given
Get popular stories submitted by given user friends.
get_upcoming_stories_by_friends ($user, \%params)
Given
Get upcoming stories submitted by given user friends.
get_stories_dugg_by_friends ($user, \%params)
Given
Get stories dugg by given user friends.
get_stories_commented_by_friends ($user, \%params)
Given
Get stories commented by given user friends.
get_diggs (\%params)
Given
Get all diggs.
get_popular_diggs (\%params)
Given
Get all popular diggs.
get_upcoming_diggs (\%params)
Given
Get all upcoming diggs.
get_diggs_by_storyid ($storyid, \%params)
Given
Get all diggs for a given story.
get_diggs_by_storyids (@storyids, \%params)
Given
Get all diggs for a list of stories with the given ids.
get_diggs_by_user ($user, \%params)
Given
Get one user's diggs for all stories.
get_diggs_by_userids (@ids, \%params)
Given
Get several users' diggs for all stories
get_user_digg_by_storyid ($id, $user, \%params)
Given
Get one user digg for a given story.
get_comments (\%params)
Given
Get all comments.
get_popular_comments (\%params)
Given
Get all comments on popular stories.
get_upcoming_comments (\%params)
Given
Get all comments on upcoming stories.
get_comments_by_ids (@ids, \%params)
Given
Get all comments for a list of stories with the given ids.
get_comments_by_id ($id, \%params)
Given
Get top-level comments for a given story.
($user, \%params)
Given
Get one user's comments for all stories.
get_comments_by_users (@users, \%params)
Given
Get several users' comments for all stories.
get_comment_by_storyid_commentid ($storyid, $commentid, \%params)
Given
Get one comment for a given story.
get_comment_by_storyid_commentid ($storyid, $commentid, \%params)
Given
Get one level of replies to one comment for a given story.
get_errors (\%params)
Given
Get a list of all error codes and messages.
get_error_code ($code, \%params)
Given
Get the message for a specific error code.
get_topics (\%params)
Given
Get a list of all topics.
get_topic_by_name ($topic, \%params)
Given
Get the specified topic.
get_users (\%params)
Given
Get all users.
get_user_by_name ($name, \%params)
Given
Get named user.
get_users_friends ($name, \%params)
Given
Get named user's friends.
get_users_fans ($name, \%params)
Given
Get users who count the named user as a friend.
get_user_by_name_fan_name ($name, $fanName, \%params)
Given
Get named user's friend.
get_galleryphotos (\%params)
Given
Get all gallery photos.
get_galleryphotos_by_ids (@ids, \%params)
Given
Get a list of galleryphotos with the given ids
get_galleryphotos_by_id ($id, \%params)
Given
Get a list of galleryphotos with the given ids
get_galleryphotos_comments ($id, \%params)
Given
Get all gallery photo comments.
get_galleryphotos_comments_by_ids (@ids, \%params)
Given
Get all gallery photo comments for given ids.
get_galleryphoto_comments_by_id ($id, \%params)
Given
Get top-level comments for a given gallery photo.
get_galleryphoto_comment_by_photoid_commentid ($photoid, $commentid, \%params)
Given
Get one comment for a given gallery photo.
get_galleryphoto_comment_replies_by_photoid_commentid ($photoid, $commentid, \%params)
Given
Get one level of replies to one comment for a given gallery photo.
get_media (\%params)
Given
Get a list of all media.
get_media_by_name ($short_name, \%params)
Given
Get a specified medium.
get_containers (\%params)
Given
Get a list of all containers.
get_container_by_name ($short_name, \%params)
Given
Get a specified container.
handle_args (\%params)
Given
Returns the query string for an API request.
DESCRIPTION
This module allows developers to quickly consume and interface with the Digg API as defined at http://apidoc.digg.com
EXAMPLES
- my $digg = Net::Digg->new();
- # Print the user that submitted the latest upcoming story.
- my $result = $digg->get_upcoming_stories();
- print $result->{ 'stories' }[0]->{'title'};
- # Print the titles of the twenty latest popular stories
- my %params = ('count' => 20);
- $result = $digg->get_popular_stories(\%params);
- my $stories = $result->{'stories'};
- foreach $story (@$stories) {
- print $story->{'title'} . "\n";
- }
CONFIGURATION AND ENVIRONMENT
Net::Digg uses LWP internally. Any environment variables that LWP supports should be supported by Net::Digg.
DEPENDENCIES
BUGS AND LIMITATIONS
I decided to use JSON::Any to parse and convert the JSON returned from the Digg API. The main reason for this is that other similar modules seemed to be using this strategy. I should check to see if there is easier or more desirable way to handle the returned data.
Please report any bugs or feature requests to bug-net-digg@rt.cpan.org
, or through the web interface at http://rt.cpan.org.
VERSION
This document describes Net::Digg version 0.1.
AUTHOR
Kurt Wilms
wilms@cs.umn.edu
http://www.kurtwilms.com/
Hey, if you download this module, drop me an email! That's the fun
part of this whole open source thing.
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included in the distribution and available in the CPAN listing for Net::Digg (see www.cpan.org or search.cpan.org).
DISCLAIMER
To the maximum extent permitted by applicable law, the author of this module disclaims all warranties, either express or implied, including but not limited to implied warranties of merchantability and fitness for a particular purpose, with regard to the software and the accompanying documentation.