fixed weather search
This commit is contained in:
		
							parent
							
								
									49e8df2239
								
							
						
					
					
						commit
						b738b64a8c
					
				@ -25,12 +25,12 @@ get_weather() {
 | 
			
		||||
    LAT=$(echo "$COORDS" | awk -F , '{print $1}')
 | 
			
		||||
    LON=$(echo "$COORDS" | awk -F , '{print $2}')
 | 
			
		||||
    
 | 
			
		||||
    url="https://api.openweathermap.org/data/2.5/weather\?lat=$LAT\&lon=$LON\&appid=$API_KEY\&units=imperial"
 | 
			
		||||
    url="https://api.openweathermap.org/data/2.5/weather?lat=$LAT&lon=$LON&appid=$API_KEY&units=$UNITS"
 | 
			
		||||
    res=$(curl --silent -fL "$url")
 | 
			
		||||
    echo "$res"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
while getopts "c:s:z:" opt; do
 | 
			
		||||
while getopts "c:s:z:u:" opt; do
 | 
			
		||||
    case "$opt" in
 | 
			
		||||
        'c' )
 | 
			
		||||
            COORDS="$OPTARG"
 | 
			
		||||
@ -41,6 +41,8 @@ while getopts "c:s:z:" opt; do
 | 
			
		||||
        'z' )
 | 
			
		||||
            ZIPCODE="$OPTARG"
 | 
			
		||||
            ;;
 | 
			
		||||
        'u' )
 | 
			
		||||
            UNITS="$OPTARG"
 | 
			
		||||
        '?' )
 | 
			
		||||
            echo "ERROR: UNRECOGNZIED ARGUMENT"
 | 
			
		||||
            exit 1
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user