Net::Backtweet - client for the backtweet API


Net-Backtype documentation Contained in the Net-Backtype distribution.

Index


Code Index:

NAME

Top

Net::Backtweet - client for the backtweet API

VERSION

Top

version 0.03

SYNOPSIS

Top

  use Net::Backtweet;
  my $client = Net::Backtweet->new();
  my $res = $client->tweets_by_url(q => 'lumberjaph', key => 's3kr3t');

DESCRIPTION

Top

Net::Backtype is a client for the backtweet API.

METHODS

tweets_by_url

Retrieve the number of tweets that link to a particular URL.

    my $tweets = $client->tweets_by_url(q => 'lumberjaph', key => 's3kr3t');

q query (required)
key API key (required)
itemsperpage number of items per page (optional)
start date start (optional)
end date end (optional)

See http://www.backtype.com/developers/tweets-by-url.

stats_by_url

Retrieve the number of tweets that link to a particular URL.

    my $stats = $client->stats_by_url(q => 'lumberjaph', key => 's3kr3t');

q query (required)
key API key (required)

See http://www.backtype.com/developers/tweet-count.

good_tweets_by_url

Retrieve filtered tweets that link to a given URL with both shortened and unshortened links. This returns a subset of Tweets by URL.

    my $good = $client->good_tweets_by_url(q => 'lumberjaph', key => 's3kr3t');

q query (required)
key API key (required)

See http://www.backtype.com/developers/good-tweets.

See http://backtweets.com/api for more information about the backtweets API.

AUTHOR

Top

  franck cuny <franck@lumberjaph.net>

COPYRIGHT AND LICENSE

Top


Net-Backtype documentation Contained in the Net-Backtype distribution.

package Net::Backtweet;
BEGIN {
  $Net::Backtweet::VERSION = '0.03';
}

# ABSTRACT: client for the backtweet API

use Moose;
use Net::HTTP::API;
extends 'Net::Backtype';

net_api_declare backtweet => (
    base_url    => 'http://api.backtype.com',
    format      => 'json',
    format_mode => 'append',
);

net_api_method tweets_by_url => (
    description =>
      'Retrieve tweets that link to a given URL, whether the links are shortened or unshortened.',
    path     => '/tweets/search/links',
    method   => 'GET',
    params   => [qw/q key itemsperpage start end/],
    required => [qw/q key/],
    expected => [qw/200/],
);

net_api_method stats_by_url => (
    description =>
      'Retrieve the number of tweets that link to a particular URL.',
    path     => '/tweetcount',
    method   => 'GET',
    params   => [qw/q batch key/],
    required => [qw/q key/],
    expected => [qw/200/],
);

net_api_method good_tweets_by_url => (
    description =>
      'Retrieve filtered tweets that link to a given URL with both shortened and unshortened links. This returns a subset of Tweets by URL.',
    path     => '/goodtweets',
    method   => 'GET',
    params   => [qw/q key/],
    required => [qw/q key/],
    expected => [qw/200/],
);

# back compatibility
sub backtweet_search {
    (shift)->tweets_by_url(@_);
}

1;


__END__