| blib/lib/WWW/jsonip.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| statement | 7 | 9 | 77.7 |
| branch | n/a | ||
| condition | n/a | ||
| subroutine | 3 | 3 | 100.0 |
| pod | n/a | ||
| total | 10 | 12 | 83.3 |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 1 | 16158 | use strict; | |||
| 1 | 2 | ||||||
| 1 | 33 | ||||||
| 2 | 1 | 1 | 3 | use warnings; | |||
| 1 | 2 | ||||||
| 1 | 47 | ||||||
| 3 | package WWW::jsonip; | ||||||
| 4 | 1 | 1 | 298 | use WWW::REST::Simple qw/get/; | |||
| 0 | |||||||
| 0 | |||||||
| 5 | use utf8; | ||||||
| 6 | |||||||
| 7 | # ABSTRACT: get a JSON format ip info | ||||||
| 8 | |||||||
| 9 | use base 'Exporter'; | ||||||
| 10 | our @EXPORT = qw/json_ip ip_detail/; | ||||||
| 11 | |||||||
| 12 | our $VERSION = '0.001'; | ||||||
| 13 | |||||||
| 14 | sub json_ip { | ||||||
| 15 | get('http://jsonip.cn'); | ||||||
| 16 | } | ||||||
| 17 | |||||||
| 18 | sub ip_detail { | ||||||
| 19 | get('http://jsonip.cn/i'); | ||||||
| 20 | } | ||||||
| 21 | |||||||
| 22 | 1; | ||||||
| 23 | |||||||
| 24 | __END__ |