diff --git a/README.md b/README.md
index 97aa4f0..fc997d6 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,7 @@
-This is a collection of stuff driving the http://weather.im website
+Weather.IM
+==========
+
+This is a collection of stuff driving the [weather.im website](https://weather.im).
This website is playground of Iowa Environmental Mesonet related weather +
-instant messaging apps
\ No newline at end of file
+instant messaging apps.
diff --git a/html/facebook.php b/html/facebook.php
deleted file mode 100644
index 433aa5b..0000000
--- a/html/facebook.php
+++ /dev/null
@@ -1,114 +0,0 @@
-require_login(); }
-
-$has_permission = $facebook->api_client->users_hasAppPermission("publish_stream");
-
-
-
-include("$rootpath/include/wfo_locs.php");
-$postgis = pg_connect("dbname=postgis");
-$rs = pg_prepare($postgis, "QUERYFOR", "SELECT * from
- iemface_user_subscriptions WHERE userid = $1");
-$rs = pg_prepare($postgis, "DELETEALL", "DELETE from
- iemface_user_subscriptions WHERE userid = $1");
-$rs = pg_prepare($postgis, "INSERT", "INSERT into
- iemface_user_subscriptions(userid, channel) VALUES ($1,$2)");
-$rs = pg_prepare($postgis, "SELECTUSER", "SELECT * from
- iemface_user_details WHERe userid = $1");
-$rs = pg_prepare($postgis, "INSERTUSER", "INSERT into
- iemface_user_details(userid) VALUES($1)");
-
-/* Look for our user*/
-$rs = pg_execute($postgis, "SELECTUSER", Array($user_id));
-if (pg_num_rows($rs) == 0){
- pg_execute($postgis, "INSERTUSER", Array($user_id));
-}
-
-$attachment = Array(
- 'name' => 'Weather.IM',
- 'href' => "http://weather.im/facebook.php",
- 'caption' => 'caption',
- 'description' => 'Feature Image',
- 'media' => array(array('type' => 'image',
- 'src' => "http://weather.im/img/bender.jpg",
- 'href' => "http://weather.im/facebook.php")),
-);
-$action_links = array(
- array('text' => 'Permalink',
- 'href' => "http://weather.im/facebook.php"));
-
-
-if (isset($_REQUEST["do"])){
- pg_execute($postgis, "DELETEALL", Array($user_id));
-
- if (isset($_REQUEST["channels"])){
- $msg = "I subscribed to Forecast Discussion's from offices: ";
- while( list($idx,$channel) = each($_REQUEST["channels"])){
- pg_execute($postgis, "INSERT", Array($user_id, $channel));
- $msg .= " [$channel], ";
- }
- if(!$has_permission){
- //echo "
Hello Facebook User! You can configure this form to allow me to post -notifications to your faceback immediately when your favorite National -Weather Service forecast issues an Area Forecast Discussion.
- - - diff --git a/html/index.php b/html/index.php index 270f430..e077b82 100644 --- a/html/index.php +++ b/html/index.php @@ -29,4 +29,3 @@ EOF; $t->render('single.phtml'); -?> \ No newline at end of file diff --git a/html/p.php b/html/p.php index 77c4551..8335f80 100644 --- a/html/p.php +++ b/html/p.php @@ -18,21 +18,20 @@ WHERE pil = $1 and entered between $2 and $3 ORDER by entered ASC LIMIT 100"); $ts = gmmktime( substr($e,8,2), substr($e,10,2), 0, - substr($e,4,2), substr($e,6,2), substr($e,0,4) ); + substr($e,4,2), substr($e,6,2), substr($e,0,4) ); $offset0 = 0; $offset1 = 60; $rs = pg_execute($pgconn, "_LSELECT", Array($pil, - date("Y-m-d H:i", $ts+$offset0), - date("Y-m-d H:i", $ts+$offset1))); + date("Y-m-d H:i", $ts+$offset0), + date("Y-m-d H:i", $ts+$offset1))); if (pg_numrows($rs) < 1){ - echo "". htmlentities($d) ."\n"; + $row = pg_fetch_assoc($rs, 0); + $d = preg_replace("/\r\r\n/", "\n", $row["data"]); + echo "
". htmlentities($d) ."\n"; } } -?>