Skip to content

straux/Gnip-Rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NAME

Gnip::Rules - REST client managing rules for Gnip API

SYNOPSIS

use Gnip::Rules;
use Try::Tiny;

my $client = Gnip::Rules->new(
    user => 'user',
    password => 'password',
    base_url => 'base_url',
    spore_spec => 'spore-spec/gnip.json',
    account => 'Account',
    publisher => 'twitter',
);

# get rules
try {
    my $rules = $client->get_rules;
} catch {
    die $_->raw_body."\n";
};

# set rules
try {
    my $rules = $client->set_rules({
        rules => [
            { value => "rule" },
            { value => "rule_with_tag", tag => "tag" },
        ]
    });
} catch {
    die $_->raw_body."\n";
};

# delete rules
try {
    my $rules = $client->delete_rules({
        rules => [
            { value => "rule" },
            { value => "rule_with_tag", tag => "tag" },
        ]
    });
} catch {
    die $_->raw_body."\n";
};

DESCRIPTION

Gnip::Rules is an REST client managing rules for Gnip API, available at http://docs.gnip.com/w/page/23733233/Rules%20Methods%20Documentation

METHODS

my $client = Gnip::Rules->new( %args );

user, password

Credentials for authentification.

base_url

Base URL for the API, including your gnipboxname.

spore_spec

Path to Net::HTTP::Spore specification file (see spore-spec/gnip.json in the package).

account publisher

Gnip acccount and publisher.

get_rules( %opt )

set_rules( \%rules )

delete_rules( \%rules )

update_rules( \%rules, %opt )

NOTES

The API uses the HTTPS protocol. For this, you need to install the Net::SSLeay module.

AUTHOR

Stéphane Raux <stephane.raux@linkfluence.net>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

AnyEvent::Gnip::Stream Net::HTTP::Spore

About

REST Client managing rules for Gnip API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages