NAME

WWW::Google::Moderator - Interface to Google Moderator API.

VERSION

Version 0.01

DESCRIPTION

This module is intended for anyone who wants to write applications that can interact with the Google Moderator API using REST. Google Moderator is a tool for collecting ideas, questions, and recommendations from audiences of any size. Courtesy limit is 1,000,000 queries per day. Currently it supports version v1.

Important:The version v1 of the Google Moderator API is in Labs, and its features might change unexpectedly until it graduates.

CONSTRUCTOR

The constructor expects your application API Key at the least, which you can get it for FREE from Google.

+-------------+----------------------------------------------------------------------------------------+
| Parameter   | Meaning                                                                                |
+-------------+----------------------------------------------------------------------------------------+
| alt         | Alternative data representation format. If you don't specify an alt parameter, the     |
|             | Moderator server returns data in the JSON format. This is equivalent to alt=json. The  |
|             | The Moderator API currently supports only the JSON data format.                        |
| api_key     | Your application API key. You should supply a valid API key with all requests. Get a   |
|             | key from the Google APIs console.                                                      |
| prettyprint | Returns a response with indentations and line breaks. If prettyprint=true, the results |
|             | returned by the server will be human readable (pretty printed).                        |
+-------------+----------------------------------------------------------------------------------------+

use strict; use warnings;
use WWW::Google::Moderator;

my $api_key   = 'Your_API_Key';
my $moderator = WWW::Google::Moderator->new($api_key);

METHODS

get_series_detail()

Retrieve series details for the given series id.

use strict; use warnings;
use WWW::Google::Moderator;

my $api_key   = 'Your_API_Key';
my $moderator = WWW::Google::Moderator->new($api_key);
my $detail    = $moderator->get_series_detail(25173);

get_topic_detail()

Retrieve given topic details of given topic id of the given series id.

use strict; use warnings;
use WWW::Google::Moderator;

my $api_key   = 'Your_API_Key';
my $moderator = WWW::Google::Moderator->new($api_key);
my $detail    = $moderator->get_topic_detail(25173, 64);

get_submission_detail()

Retrieve submission detail of the given submission id of the given series id.

use strict; use warnings;
use WWW::Google::Moderator;

my $api_key   = 'Your_API_Key';
my $moderator = WWW::Google::Moderator->new($api_key);
my $detail    = $moderator->get_submission_detail(25173, 175182);

get_topics()

Retrieve all topics in the given series id.

+-------------+----------------------------------------------------------------------------------------+
| Parameter   | Meaning                                                                                |
+-------------+----------------------------------------------------------------------------------------+
| series-id   | Series Id                                                                              |
|             |                                                                                        |
| max-results | The maximum number of elements to return with this request. Default: max-results=20;   |
|             | Maximum allowable value: max-results=100.                                              |
|             |                                                                                        |
| start-index | The position in the collection at which to start the list of results. The index of the |
|             | first item is 1.                                                                       |
+-------------+----------------------------------------------------------------------------------------+

use strict; use warnings;
use WWW::Google::Moderator;

my ($api_key, $moderator, $topics);
$api_key   = 'Your_API_Key';
$moderator = WWW::Google::Moderator->new($api_key);
$topics    = $moderator->get_topics(25173);
# or
$topics    = $moderator->get_topics('series-id' => 25173);

get_series_submissions()

Retrieve all submissions in the given series id.

+------------------+-----------------------------------------------------------------------------------------+
| Parameter        | Meaning                                                                                 |
+------------------+-----------------------------------------------------------------------------------------+
| series-id        | Series Id                                                                               |
|                  |                                                                                         |
| q                | Full-text query string                                                                  |
|                  |                                                                                         |
| hasAttachedVideo | Restricts the submissions returned to those that have attached videos. You can restrict |
|                  | the returned submissions to those with video attachments by specifying                  |
|                  | hasAttachedVideo=true. Ignored if the q query parameter is specified.                   |
|                  |                                                                                         |
| sort             | You can change the ordering by setting the sort parameter to be one of these values:    |
|                  | RANK_DESCENDING - The most popular to least popular votes (this is the default).        |
|                  | RANK_ASCENDING  - The least popular to most popular votes.                              |
|                  | HOT_DESCENDING  - Those that have gained the most popularity recently.                  |
|                  | DATE_SUBMITTED_DESCENDING - The newest creation time to the oldest.                     |
|                  | DATE_SUBMITTED_ASCENDING  - The oldest creation time to the newest.                     |
|                  |                                                                                         |
| max-results      | The maximum number of elements to return with this request. Default: max-results=20;    |
|                  | Maximum allowable value: max-results=100.                                               |
|                  |                                                                                         |
| start-index      | The position in the collection at which to start the list of results. The index of the  |
|                  | first item is 1.                                                                        |
+------------------+-----------------------------------------------------------------------------------------+

use strict; use warnings;
use WWW::Google::Moderator;

my ($api_key, $moderator, $submissions);
$api_key     = 'Your_API_Key';
$moderator   = WWW::Google::Moderator->new($api_key);
$submissions = $moderator->get_series_submissions(25173);
# or
$submissions = $moderator->get_series_submissions('series-id' => 25173);

get_topic_submissions()

Retrieve all submissions in the given topic id of the given series id.

+------------------+-----------------------------------------------------------------------------------------+
| Parameter        | Meaning                                                                                 |
+------------------+-----------------------------------------------------------------------------------------+
| series-id        | Series Id                                                                               |
|                  |                                                                                         |
| topic-id         | Topic Id                                                                                |
|                  |                                                                                         |
| q                | Full-text query string                                                                  |
|                  |                                                                                         |
| hasAttachedVideo | Restricts the submissions returned to those that have attached videos. You can restrict |
|                  | the returned submissions to those with video attachments by specifying                  |
|                  | hasAttachedVideo=true. Ignored if the q query parameter is specified.                   |
|                  |                                                                                         |
| sort             | You can change the ordering by setting the sort parameter to be one of these values:    |
|                  | RANK_DESCENDING - The most popular to least popular votes (this is the default).        |
|                  | RANK_ASCENDING  - The least popular to most popular votes.                              |
|                  | HOT_DESCENDING  - Those that have gained the most popularity recently.                  |
|                  | DATE_SUBMITTED_DESCENDING - The newest creation time to the oldest.                     |
|                  | DATE_SUBMITTED_ASCENDING  - The oldest creation time to the newest.                     |
|                  |                                                                                         |
| max-results      | The maximum number of elements to return with this request. Default: max-results=20;    |
|                  | Maximum allowable value: max-results=100.                                               |
|                  |                                                                                         |
| start-index      | The position in the collection at which to start the list of results. The index of the  |
|                  | first item is 1.                                                                        |
+------------------+-----------------------------------------------------------------------------------------+

use strict; use warnings;
use WWW::Google::Moderator;

my ($api_key, $moderator, $submissions);
$api_key     = 'Your_API_Key';
$moderator   = WWW::Google::Moderator->new($api_key);
$submissions = $moderator->get_topic_submissions(25173, 64);
# or
$submissions = $moderator->get_topic_submissions('series-id' => 25173, 'topic-id' => 64);

AUTHOR

Mohammad S Anwar, <mohammad.anwar at yahoo.com>

BUGS

Please report any bugs or feature requests to bug-www-google-moderator at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Google-Moderator. I will be notified and then you'll automatically be notified of progress on your bug as I make changes.

TODO

  • Creating a user's vote.

  • Creating a new topic in a series.

  • Creating a submission for a topic.

  • Updating a vote for the user.

  • Retrieving all votes for the authenticated user.

  • Retrieving the user's vote for a specific submission.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc WWW::Google::Moderator

You can also look for information at:

LICENSE AND COPYRIGHT

Copyright 2011 Mohammad S Anwar.

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 http://dev.perl.org/licenses/ for more information.

DISCLAIMER

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.