summaryrefslogtreecommitdiffstats
path: root/util/weather.perl
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-07 23:13:44 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-07 23:13:44 +0800
commitae31e19f92e717919ac8e3db9039eb38d2b89aae (patch)
treec70164d6a1852344f44b04a653ae2815043512af /util/weather.perl
downloadpttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.gz
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.bz2
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.lz
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.xz
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.tar.zst
pttbbs-ae31e19f92e717919ac8e3db9039eb38d2b89aae.zip
Initial revision
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@1 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/weather.perl')
-rw-r--r--util/weather.perl31
1 files changed, 31 insertions, 0 deletions
diff --git a/util/weather.perl b/util/weather.perl
new file mode 100644
index 00000000..c9a35406
--- /dev/null
+++ b/util/weather.perl
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+# $Id: weather.perl,v 1.1 2002/03/07 15:13:46 in2 Exp $
+#
+# 不能跑的話,看看 bbspost 的路徑是否正確。
+# 如果發出的 post 沒有氣象報告而是說 URL 找不到,則確定一下能不能看到
+# 中央氣象局的 WWW 及 URL 是否正確。
+# 理論上適用所有 Eagle BBS 系列。
+# -- Beagle Apr 13 1997
+open(BBSPOST, "| bin/webgrep>etc/weather.tmp");
+# 日期
+open(DATE, "date +'%a %b %d %T %Y' |");
+$date = <DATE>;
+chop $date;
+close DATE;
+
+# Header
+# 內容
+open(WEATHER, "/usr/bin/lynx -dump http://www.cwb.gov.tw/V3.0/weather/text/Data/W03.txt |");
+while (<WEATHER>) {
+ print BBSPOST if ($_ ne "\n");
+}
+close WEATHER;
+
+# 簽名檔
+print BBSPOST "\n--\n";
+print BBSPOST "我是beagle所有可愛的小餅乾...跨海為Ptt服務\n";
+print BBSPOST "--\n";
+print BBSPOST "☆ [Origin: ◎果醬小站◎] [From: [藍莓鬆餅屋] ] ";
+
+close BBSPOST;
+