Perl library for Apixu Weather API
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
APIXU/API
.gitattributes
.gitignore
README
test.cgi

README

Welcome to the perl APIXU sdk
=============================

This SDK is a very simple inteface into the APIXU APIs.

Quick Example::

    use APIXU::API::APIXU;
    my $api_key      = 'your_api_key';
    my $apixu = APIXU::API::APIXU->new($api_key);

    my $api_explorer = 'Current';

    my $json_decoded_hash_ref;
    if ($api_explorer eq 'Current') {
        my $location     = 'Paris';
        $json_decoded_hash_ref = $apixu->get_current($location);
    }
    elsif($api_explorer eq 'Forecast'){
        my $location     = 'Paris';
        my $days         = '2';   
        $json_decoded_hash_ref = $apixu->get_forecast($location, $days);
    }


Getting Started
---------------
The module we are using is APIXU::API::APIXU

Make sure that following cpan modules are already installed.
1. LWP::UserAgent
2. HTTP::Request::Common


Step 1 : Use the module by 'use APIXU::API::APIXU;' statement.

Step 2 : Create the object by 'my $apixu = APIXU::API::APIXU->new($api_key);' statement

Step 3 : Get API response
    
        We have 2 methods in APIXU,
        'get_current' is for getting 'current' weather and the 'get_forecast' is for 'forecast' weather.
        
        'get_current' method is to be called with the parameter location
        Eg : $apixu->get_current($location);
        
        'get_forecast' method is to be called with the parameters location and days
        Eg : $apixu->get_current($location, $days);
        
        The return value will be a perl hash reference equivalent to the json response from the API.
        
        You can take the response like following 
        $json_decoded_hash_ref = $apixu->get_forecast($location, $days);


Support
-------

Version 1.0, 2015-06-27