Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 45 lines (41 sloc) 1.388 kB
e435e6c @sramsay Added -forecast7 switch (7-day forecast).
authored
1 /*
75fe61d @sramsay Changed the (deprecated) forecast7 to forecast10.
authored
2 * forecast10.go
e435e6c @sramsay Added -forecast7 switch (7-day forecast).
authored
3 *
4 * This file is part of wu. It contains functions related to
75fe61d @sramsay Changed the (deprecated) forecast7 to forecast10.
authored
5 * the -forecast10 switch (10-day forecast).
e435e6c @sramsay Added -forecast7 switch (7-day forecast).
authored
6 *
7 * Written and maintained by Stephen Ramsay <sramsay.unl@gmail.com>
8 * and Anthony Starks.
9 *
75fe61d @sramsay Changed the (deprecated) forecast7 to forecast10.
authored
10 * Last Modified: Tue May 29 12:55:56 CDT 2012
e435e6c @sramsay Added -forecast7 switch (7-day forecast).
authored
11 *
982eb06 @sramsay Updated copyright date string.
authored
12 * Copyright © 2010-2012 by Stephen Ramsay and Anthony Starks.
e435e6c @sramsay Added -forecast7 switch (7-day forecast).
authored
13 *
14 * wu is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3, or (at your option)
17 * any later version.
18 *
19 * wu is distributed in the hope that it will be useful, but WITHOUT
20 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
22 * License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with wu; see the file COPYING. If not see
26 * <http://www.gnu.org/licenses/>.
27 */
28
a385f01 @sramsay Reorganizing files.
authored
29 package main
e435e6c @sramsay Added -forecast7 switch (7-day forecast).
authored
30
31 import (
3bed8a0 @sramsay Reformatting.
authored
32 "fmt"
e435e6c @sramsay Added -forecast7 switch (7-day forecast).
authored
33 )
34
35 // printForecast prints the forecast for a given station to standard out
e9840ce @sramsay Removed reundant data structure (now singly represented in forecast.go).
authored
36 // The dat structure on which it depends is in forecast.go.
75fe61d @sramsay Changed the (deprecated) forecast7 to forecast10.
authored
37 func PrintForecast10(obs *ForecastConditions, stationId string) {
3bed8a0 @sramsay Reformatting.
authored
38 t := obs.Forecast.Txt_forecast
39 fmt.Printf("Forecast for %s\n", stationId)
40 fmt.Printf("Issued at %s\n", t.Date)
41 for _, f := range t.Forecastday {
42 fmt.Printf("%s: %s\n", f.Title, f.Fcttext)
43 }
e435e6c @sramsay Added -forecast7 switch (7-day forecast).
authored
44 }
Something went wrong with that request. Please try again.