TIP: Click on subject to list as thread! ANSI
echo: bbbs.english
to: ALL
from: JANIS KRACHT
date: 2017-02-03 22:10:00
subject: Weather door

I've updated my weather door.  Now it deletes the file it creates in the bbbs/
home direcory, and it displays more information.

You can enter the city name (single word), or a two-word name in quotes or
separated with _, like New_York, or you can enter the zip code instead of any
of those.

// start getweather.bz
// by janis kracht

int main() {
char cs,ga,cc,sp,cg,x;
cs="";
int l;
bbbs("cls");

printf("\e[1;1H\e[1;33mTo get the weather for names containing spaces,");
printf("\e[2;1H\e[1;33menter the name in quotes or use an underscore");
printf("\e[3;1H\e[1;33mfor example, both \"new york\" and new_york work.");
printf("\e[4;1H\e[1;33m Or enter your Zip Code if you prefer.");
printf("\n\n");
cs=input("Enter City:    ",50,0);
cc=sprintf("\"%s\"",cs);
system(sprintf("/usr/bin/curl wttr.in/%s -O",cc),1,0);
system(sprintf("/usr/bin/head -n 17 %s",cc),1,0); printf("\e[40;1H\e[1;33mPress
a key to continue"); getch();
rename(cc, "fubba.fil");
remove("/home/bbbs/fubba.fil");
bbbs("cls");
}

// end getweather.bz


The "more information" it displays is a 120char wide display of that days'
weather: morning, noon, evening and night.

I'm thinking of making that a choice where the short choice would be what it
was displaying when I first worked on this, such as:

Weather for  Zipcode: 14881

   \  /       Partly cloudy
  _ /"".-.     3 - 15 °F
    \_(   ).   -> 10 mph
    /(___(__)  9 mi
               0.0 in



and the alternate would be the "long choice", showing graphics for all the time
periods mentioned above.

Anyway, that's where the door is at so far :)

Take care,
Janis

--- BBBS/Li6 v4.10 Toy-3
* Origin: Prism bbs (1:261/38)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.