Table of Contents | ||
---|---|---|
|
Technologies Used
(Link: http://wx.uconn.edu/)
- PHP, JS, HTML, CSS + MySQL Database
- Built using Drupal v7
- 3rd Party Drupal Modules
At the Heart of the Portal
Weather Sources
We source weather information from 3 different sources:
- Weather.gov
- Weather Underground
- Accu Weather
Source #2 is no longer operational (maybe due to changes on Weather Underground's end?) and #3 was not implemented; therefore, the following is w/respect to just the first source.
Portal Access
Individual must have a NetID, in order to access any parts of the portal. Upon authentication, the individual must be one of four roles (ordered as most access to least access—i.e. least restrictive to most restrictive)—
- Administrator (12 Members)
- OEM_Admin (5 Members)
- Weather_Group (20 Members)
- Weather_Viewer (6 Members)
Portal Content
At the Heart of the Portal: Unified Weather Outlook
The home page of the Weather portal boasts weather of UConn Storrs, UConn Health and all UConn regional campuses: Storrs, Avery Point, Farmington, Hartford, Law School, Stamford, & Waterbury.
...
At the bottom of the home/landing page, we are displaying detailed forecast—for each of the 7 locations:
Weather Sources
We source weather information from 3 different sources:
- Weather.gov
- Weather Underground
- Accu Weather
Source #2 is no longer operational (maybe due to changes on Weather Underground's end?) and #3 was not implemented; therefore, the following is w/respect to just the first source.
Method
The way we are accomplishing this, is using PHP Client URL Library (cURL) to fetch 7 different webpages from Weather.gov. I wrote a simple function that takes in a URL and then returns the fetched data—as shown below:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
function fetch_weather($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0'); curl_setopt($ch, CURLOPT_REFERER, 'https://forecast.weather.gov'); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); $data = curl_exec($ch); curl_close($ch); return $data; } |
There are 7 distinct URLs (each URL has been pre-set to a specific campus), as shown in the table below:
...
The middle part—the satellite/radar, is a simple iFrame embed.
The Sidebar
...
We have 3 blocks on the sidebar:
Block | Description |
---|---|
| |
| |
|
Other Content
The rest of the portal serves up static content created by the OEM Team. This content is broken down into following categories, as indicated by the top navigation menu
Content | Type |
---|---|
Wx Protocol | Static / PDF |
Wx Conference Call Agenda | Static / PDF |
Member Contact Info | Static / PDF |
UConn Health | Blank / Under Construction? |
Forecast Graphics | Static / Image |
Resources | Mix of Static / (External) Links |
Events | External Links to:
|
Everbridge | External Links to Everbridge
|