Releases: oplS17projects/Magic_Mirror
Milestone 2
Steve "Wildcat" Kim feels he met his milestone. Steve Warren had to alter his.
Steve "Wildcat" Kim:
For my milestone I wanted to not rely on hard coded values to display on the servlet. I was able to figure out how to add and automatically update the date, time and the weather for a particular location, this time choosing the lovely city of Dayton, Ohio. For my next milestone I would like to be able to set the location and have it automatically pull the date, time and weather for that location.
Steve Warren:
The unit test portion of the milestone was abandoned. Since tests seem to always run, they would cause errors in the case of network issues, which is handled by caching and handling network errors in weather.rkt. Steve "Wildcat" Kim also informed me the Professor McCarthy was not fond of these tests for a number or reasons, one of which was the inability to tests for the unknown.
As for the modules, two new additions were created: wotd.rkt (Word Of The Day) and time.rkt.
The wotd.rkt module uses webscraping in order to obtain its data from dictionary.com. I'm unsure if there was an API available for the site. The coding goal of this module was to try my hand at webscraping. All other modules at this point make use of public APIs.
The time.rkt module takes the latitude and longitude information from openweathermap.org and combines that with the request made from timezonedb.com in order to get the date and time for a given location by name. Without the latitude and longitude information from openweathermap, a subscription-based key would be necessary to obtain the data required.
In lieu of unit tests, a simple GUI application / module was set user preferences. The user would be expected to set their preferences using a keyboard. This would in theory only need to be done once. The main application can ask for the preferences and have them returned as a list. If the mirror is run without the user setting preferences, a default preference file is created with Lowell, MA as the defaults for time and weather.
The procedure, get-preferences allows the front-end to pull the preferences without using a GUI. Like the other modules, the data is passed as a list.
Preferences are stored as a json file in the root directory.
Because the preference app is new, it is expected to undergo some minor changes in the coming week.
One two… @fgmart is coming for you… 3, 4 better lock your door..5, 6 grab a crucifix… 7, 8, gonna stay up late, 9, 10, never sleep again!
Milestone 1
Both of feel as if we've met the milestones as we described in our earlier write-up.
Steve "Wildcat" Kim:
I statically am able to set up the weather to display on the left side. I wrote a variation of filter to work with a list compose of tuples(pairs) and give me what I want, that way if I want the city it will give me the actual name of the city. For my next milestone I would like to have it update dynamically. I need to write some functions to associate say cloudy with a picture of clouds. I also would like to change the background to white and the text all to be black so that I could control the contrast of the mirror.
Steve Warren:
*** weather.rkt requires the end user to obtain their own free API key from OpenWeatherMap. The key needs to be placed within the api-keys.rkt file. Please see http://openweathermap.org/ for more information on obtaining an API key. ***
The backend "module" weather.rkt works from within REPL and is ready for use by the frontend. The weather is cached and stored locally. If the data was last pulled under an hour ago, weather.rkt will pull data from a local cache instead of the remote service, otherwise it will download new data to store. This is to prevent spamming the service provider and to allow data to be displayed even in the event of a short term network outage. Weather will return an empty list in the case of a network outage. Weather.rkt is capable of providing the current weather or the seven-day forecast for a given city and state/country
Current:
(weather "current" "meredith" "nh")
(weather "current" "tokyo" "japan")
Forecast:
(weather "forecast" "meredith" "nh")
(weather "current" "tokyo" "japan")
Shop Smart. Shop @fgmart
FP4 documentation is complete
@fgmart We've completed the documentation. Files will uploaded "shortly"