gitpan / net-tribalwarsmap-api-tribelookup Goto Github PK
View Code? Open in Web Editor NEWRead-only release history for Net-TribalWarsMap-API-TribeLookup
Home Page: http://metacpan.org/release/Net-TribalWarsMap-API-TribeLookup
License: Other
Read-only release history for Net-TribalWarsMap-API-TribeLookup
Home Page: http://metacpan.org/release/Net-TribalWarsMap-API-TribeLookup
License: Other
NAME Net::TribalWarsMap::API::TribeLookup - Query general information about tribes. VERSION version 0.1.0 SYNOPSIS # Tag based lookup my $result = Net::TribalWarsMap::API::TribeLookup->get_tag('en69', 'kill'); # Generic search my @results = Net::TribalWarsMap::API::TribeLookup->search_tribes('en69', 'Alex'); # generic search with name filter my @results = Net::TribalWarsMap::API::TribeLookup->search_tribes('en69', 'lex',qr/^Alex/ ); # Advanced my $instance = Net::TribalWarsMap::API::TribeLookup->new( world => 'en69', search => 'alex', ); my $raw_results = $instance->_results; METHODS "ua" my $ua = $instance->ua; "decoder" my $decoder = $instance->decoder(); "world" my $world = $instance->world(); # en67 or similar "search" my $search = $instance->search(); "uri" my $search_uri = $class->new( world => ... , search => ... )->uri; "get_tag" my $result = $class->get_tag( $world, $tag ); For example: my $result = $class->get_tag('en69', 'kill'); If $tag is not found, "undef" is returned. "search_tribes" my @results = $class->search_tribes( $world, $search_string ); or my @results = $class->search_tribes( $world, $search_string , $name_filter_regexp ); For instance: my @results = $class->search_tribes( 'en69', 'kill' ); will return all tribes in "world en69" with the sub-string "kill" in their tag or name. my @results = $class->search_tribes( 'en69', 'kill' , qr/bar/); will return all tribes in "world en69" with the sub-string "kill" in their tag or name, where their name also matches $tribe->name =~ qr/bar/ ATTRIBUTES "ua" The HTTP User Agent to use for requests. Default is a "Net::TribalWarsMap::API::HTTP" instance. $instance->new( ua => $user_agent ); ... my $ua = $instance->ua(); "decoder" The "JSON" Decoder object my $instance = $class->new( decoder => JSON->new() ); "world" MANDATORY PARAMETER: my $instance = $class->new( world => $world_name ); This will be something like "en67", and is the prefix used in domain "URI"'s. "search" my $instance = $class->new( search => $string ); "uri" Normally this parameter is not required to be provided, and is instead composed by joining an existing base URI with "world" "search" and "_ts" my $instance = $class->new( uri => 'fully qualified search URI' ); PRIVATE ATTRIBUTES "_ts" my $instance = $class->new( _ts => "mm-dd-yyy" ); "_results" Lazy builder that returns a "json"-decoded version of the result of fetching "uri". my $instance = $class->new( _results => { %complex_structure } ); "_decoded_results" Lazy builder that returns a Hash of Objects decoded from the result of "_results" my %complex_structure = ( key => Net::TribalWarsMap::API::TribeLookup::Result->new(), key2 => Net::TribalWarsMap::API::TribeLookup::Result->new(), ); my $instance => $class->new( _decoded_results => { %complex_structure } ); PRIVATE METHODS "_ts" my $now = $instance->_ts; "_results" my $raw_results = $instance->_results; "_decoded_results" my %decoded_results = %{ $instance->_decoded_results }; AUTHOR Kent Fredric <[email protected]> COPYRIGHT AND LICENSE This software is copyright (c) 2013 by Kent Fredric <[email protected]>. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.