#! /usr/bin/perl -w use strict; use warnings; use JSON; #Have to open the web page and look in developer mode to get this info my $URL_lat = ($ARGV[0] or 40.48967); my $URL_lng = ($ARGV[1] or -111.93882); my $URL_ProID = ($ARGV[2] or 23); my $URL_StatID = ($ARGV[3] or "C3430"); my $info = `curl -sm 5 "https://www.weatherbug.com/api/observation?lat=$URL_lat&lng=$URL_lng&providerId=$URL_ProID&stationId=$URL_StatID"` or die "Error"; my $json = decode_json $info or die "Error"; my $loc = %{$json}{"Station"}->{"StationId"}; my $temp = %{$json}{"Observation"}->{"Temperature"}; my $windS = %{$json}{"Observation"}->{"WindSpeedAvg"}; my $windD = %{$json}{"Observation"}->{"WindDirectionAvg"}; print "?:".$temp.":".$windS.":".$windD.":(WB)".$loc;