6 my $conf = new FS::Conf;
8 ## new api link, see doc https://geo.fcc.gov/api/census/
9 my $url = "https://geo.fcc.gov/api/census/block/find?format=json&censusYear=" . $cgi->param('census_year') . "&latitude=" . $cgi->param('lat') . "&longitude=" . $cgi->param('lon');
11 my $ua = new LWP::UserAgent;
12 $ua->agent('Freeside/'. $FS::VERSION); #libwww* elicits "403 Forbidden"
13 my $res = $ua->get($url);
16 if ( $res->is_success ) {
17 $return = $res->decoded_content;
19 #better error handling? well, hopefully the site is reliable enough
20 warn 'Error from geo.fcc.gov: '. $res->status_line. "\n";