summaryrefslogtreecommitdiffstats
path: root/util/weather.perl
diff options
context:
space:
mode:
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;
+