Posts

Showing posts with the label weather

Yet another commnd line weather tool.

Image
Use city name  or zip (some people also say that case insensitive and, if you want to specify the nation, you can append an underscore and the nation's iso 2 or 3 letters code or the full nation name, it seems. I.e.: curl http://wittr.in/Milano_usa curl http://wittr.in/Milano_it curl http// wittr.in/Milano_italy ) $ curl http://wttr.in/austin $ curl http://wttr.in/77337 --------------------------------- Script in progress: Get your ipaddress:   $ dig +short myip.opendns.com @resolver1.opendns.com   23.43.247.204   Get location from ipadress: $ curl ipinfo.io/23.43.247.204 { "ip": "23.43.247.204", "hostname": "a23-43-247-204.deploy.static.akamaitechnologies.com", "city": "Cambridge", "region": "Massachusetts", "country": "US", "loc": "42.3626,-71.0843", "org": "AS4436 nLayer Communications, Inc.", ...

Weather pic to ascii

Image
Yet another weather picture grabber and the the picture is converted to ascii. Note: Also see http://www.instructables.com/id/Radar-graphics-in-a-text-world/ #!/bin/bash #Set variables DOWNLOAD_DIR=/tmp/weather/ WEATHER_GIF=http://archive.wfaa.com/weather/images/core/animated-loops/comp/880x495/new_tarrant.gif COUNTER=0 #check for  download directory if [ ! -d "$DOWNLOAD_DIR" ]; then   mkdir -p $DOWNLOAD_DIR fi #remove old files rm  $DOWNLOAD_DIR/*gif rm  $DOWNLOAD_DIR/*.png rm  $DOWNLOAD_DIR/*.txt #get weather gif wget $WEATHER_GIF -O "${DOWNLOAD_DIR}map.gif" #extract gif to png convert -coalesce "${DOWNLOAD_DIR}/map.gif" "${DOWNLOAD_DIR}/map.png" #convert images to text for i in $DOWNLOAD_DIR/map-*; do    img2txt -f utf8 -W 100 -H 30 $i > $i.txt done #display images while [ $COUNTER -lt 5 ] ; do   for i in $DOWNLOAD_DIR/map-*.txt; do      printf '\033[1;1H'   ...

Be a sort of weather person.

Image
You can get all kinds of gadgets for your desktop that usually sit on the top panel. One of them that can be very important is the weather.  The unit is called a barometer, which was allegedly invented in 1643 by Evangelista Torricelli.  You may need to elect to display the barometric pressure on your panel outtake. Normally during clear weather, the measure is above 30. Where you may live it may vary. In our case, the pressure is dropping. This can mean that rain is coming. And rain is in the forecast for the next day or so, Gives you a chance to outsmart the weatherman. So higher pressure is good weather for the most part. Not only can you predict the weather, you might predict when the fish might bite! Fish are much more comfortable when there's stable high pressure, and tend to feed actively most anywhere within the water column. So do not expect good fishing if it is going to get cold or bad weather is coming. You can build your own non-precise barometer wit...

Be a sort of weather person.

Image
You can get all kinds of gadgets for your desktop that usually sit on the top panel. One of them that can be very important is the weather.  The unit is called a barometer, which was allegedly invented in 1643 by Evangelista Torricelli.  You may need to elect to display the barometric pressure on your panel outtake. Normally during clear weather, the measure is above 30. Where you may live it may vary. In our case, the pressure is dropping. This can mean that rain is coming. And rain is in the forecast for the next day or so, Gives you a chance to outsmart the weatherman. So higher pressure is good weather for the most part. Not only can you predict the weather, you might predict when the fish might bite! Fish are much more comfortable when there's stable high pressure, and tend to feed actively most anywhere within the water column. So do not expect good fishing if it is going to get cold or bad weather is coming. You can build your own non-precise ...

Weather report.

Image
Notice: this site was working last week, but now it is disabled. 07/04/2018 My stepfather was into meteorology. In fact, he was a weatherman in the military, He got us into it. So I like to look at a minimal weather report. Batch files make it easier for servers to display data as needed. Have an nslu2 running linux with very low resources. So a batch file is perfect for grabbing data off the web. You can also use it for mobile devices.  That also means you can insert the data grabbed into a database for later research, Actually I have been doing weather scraping for a while, This is probably almost the tenth script I have written.  From the command line it might look like this: ~$ ./gwp2.sh 22546 The weather for 22546 on Sep 19: Updated: 7:05 AM EDT on September 19, 2013 Observed at Mantico Hill, Beaverdam, Virginia Temperature 47.8°F / 8.8°C Humidity 98% Dew Point 47°F / 8°C Windchill 48°F / 9°C Win...

The weather.

Image
A while back I had developed a way to download weather maps and then convert them to ascii for use on text only terminal or character lcd’s Made a modification or two in some of the code. As you remember we modified the crontab file so the system would download radar images once a minute. Crontab: Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # indicating with different fields when the task will be run # and what command to run for the task # # To define the time you can provide concrete values for # minute (m), hour (h), day of month (dom), month (mon), # and day of week (dow) or use ‘*’ in these fields (for ‘any’).# # Notice that tasks will be started based on the cron’s system # daemon’s notion of time and timezones. # # Output of the crontab jobs (including errors) is sent through # email to the user the crontab file belongs to (unless redirected). # # For example, you can run a backup of al...

Weather radar in ascii.

Image
Once in a while I sort of come up with a neat idea. At least it is to me. Just because you have an old system, does not mean you can not teach it new tricks. Done a lot of page scraping to get weather details, but it would be nice to use radar screens from the command line. So details in this case are not so necessary. The overall view of the weather to see what kinds of weather fronts are approaching is. Here we go. We need to collect some historical data (i.e. radar screens). You can get these from the radar.weather.gov using the 3 letter designation for the area you are interested in. For example, I believe the Dallas Fort Worth area is supposed to be FWS. You do not have to collect data just for your area. Collect data for several areas and get an overview of the weather all around. (http://www.leonardsguide.com/us-airport-codes.shtml) You need to collect data. Cron is the perfect tool for the job. We need to create a batch file that will collect the pictures usin...

Using a simple Google API.

Preface: There is a computer programming language that is oriented towards new developers. That language is called Python. It is available for most every platform. (i.e. MSWindows, OS/X, BSD,. Linux and etc.  Though there are no fancy graphics in what was done in this project, you could surely add that feature. Just wanted to show a bare bones project that anyone could use to start with. One of the reasons I like to do page scraping is to get the data I need without having to take time to use a web browser such as Firefox and or a newsreader to get the specific data I need. Letting the computer get the data for me and making a summary file of the data I need is therefore letting the computer be my secretary and or research assistant. Have been doing some page scraping, but i was not able to get the weather from their (Google) site. Then read they have it sort of hidden. Was able to get a page of the xml they use to show the data. Aha!   Then found a short piece ...

Evolution of a script

Image
------------------------------------------------------------------------------------------------------------- Notice: Comments are correct the scripts need to be updated. -------------------------------------------------------------------------------------------------------------  Do not have time to do it now , but it isin the queue...... Someone had written a script to grab the weather from the web. A script is like a todo list for the computer. Even if you are not a programmer, you will see the added lines give the script more potential or power. Everything becomes less and less cryptic to use. How you interact with it is sometimes considered what is called the user interface. lynx -dump "http://mobile.weather.gov/port_mp_ns.php?select=3&CityName=Woonsocwa That yielded: National Weather Service __________________________________________________________________ Woonsocket, RI Current Local Conditions a...