Commit b7465f48 authored by Zach Knox's avatar Zach Knox
Browse files

Merge 'issue16' into 'master'

parents c9f6993a d60532a1
weather/mup.json
weather/settings.json
weather/.meteor
weather/server/lib/secrets.js weather/server/lib/secrets.js
.meteor/local
.meteor/meteorite # -- Vim .gitignores --
*.~ # swap
*.swp [._]*.s[a-w][a-z]
[._]s[a-w][a-z]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags
...@@ -11,3 +11,5 @@ notices-for-facebook-graph-api-2 ...@@ -11,3 +11,5 @@ notices-for-facebook-graph-api-2
1.2.0-cordova-changes 1.2.0-cordova-changes
1.2.0-breaking-changes 1.2.0-breaking-changes
1.3.0-split-minifiers-package 1.3.0-split-minifiers-package
1.4.0-remove-old-dev-bundle-link
1.4.1-add-shell-server-package
...@@ -4,21 +4,21 @@ ...@@ -4,21 +4,21 @@
# 'meteor add' and 'meteor remove' will edit this file for you, # 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand. # but you can also edit it by hand.
meteor-base # Packages every Meteor app needs to have meteor-base@1.0.4 # Packages every Meteor app needs to have
mobile-experience # Packages for a great mobile UX mobile-experience@1.0.4 # Packages for a great mobile UX
mongo # The database Meteor supports right now mongo@1.1.12 # The database Meteor supports right now
blaze-html-templates # Compile .html files into Meteor Blaze views blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views
session # Client-side reactive dictionary for your app session@1.1.6 # Client-side reactive dictionary for your app
jquery # Helpful client-side library jquery@1.11.9 # Helpful client-side library
tracker # Meteor's client-side reactive programming library tracker@1.1.0 # Meteor's client-side reactive programming library
es5-shim # ECMAScript 5 compatibility for older browsers. es5-shim@4.6.14 # ECMAScript 5 compatibility for older browsers.
ecmascript # Enable ECMAScript2015+ syntax in app code ecmascript@0.5.8 # Enable ECMAScript2015+ syntax in app code
autopublish # Publish all data to the clients (for prototyping)
insecure # Allow all DB writes from clients (for prototyping)
zodiase:mdl zodiase:mdl
mquandalle:bower mquandalle:bower
http http@1.2.9
standard-minifier-css standard-minifier-css@1.2.0
standard-minifier-js standard-minifier-js@1.2.0
shell-server
aldeed:simple-schema # Schema support for db
aldeed:simple-schema@1.5.3
allow-deny@1.0.5 allow-deny@1.0.5
autopublish@1.0.7 autoupdate@1.3.11
autoupdate@1.2.11 babel-compiler@6.9.1
babel-compiler@6.8.4 babel-runtime@0.1.11
babel-runtime@0.1.9_1
base64@1.0.9 base64@1.0.9
binary-heap@1.0.9 binary-heap@1.0.9
blaze@2.1.8 blaze@2.1.8
blaze-html-templates@1.0.4 blaze-html-templates@1.0.4
blaze-tools@1.0.9 blaze-tools@1.0.9
boilerplate-generator@1.0.9 boilerplate-generator@1.0.9
caching-compiler@1.0.6 caching-compiler@1.1.7
caching-html-compiler@1.0.6 caching-html-compiler@1.0.6
callback-hook@1.0.9 callback-hook@1.0.9
check@1.2.3 check@1.2.3
ddp@1.2.5 ddp@1.2.5
ddp-client@1.2.9 ddp-client@1.3.1
ddp-common@1.2.6 ddp-common@1.2.6
ddp-server@1.2.9 ddp-server@1.3.10
deps@1.0.12 deps@1.0.12
diff-sequence@1.0.6 diff-sequence@1.0.6
ecmascript@0.4.7 ecmascript@0.5.8
ecmascript-runtime@0.2.12 ecmascript-runtime@0.3.14
ejson@1.0.12 ejson@1.0.12
es5-shim@4.5.13 es5-shim@4.6.14
fastclick@1.0.12 fastclick@1.0.12
fourseven:scss@3.4.1 fourseven:scss@3.9.0
geojson-utils@1.0.9 geojson-utils@1.0.9
hot-code-push@1.0.4 hot-code-push@1.0.4
html-tools@1.0.10 html-tools@1.0.10
htmljs@1.0.10 htmljs@1.0.10
http@1.1.8 http@1.2.9
id-map@1.0.8 id-map@1.0.8
insecure@1.0.7
jquery@1.11.9 jquery@1.11.9
launch-screen@1.0.12 launch-screen@1.0.12
livedata@1.0.18 livedata@1.0.18
logging@1.0.14 logging@1.1.15
meteor@1.1.16 mdg:validation-error@0.2.0
meteor@1.2.17
meteor-base@1.0.4 meteor-base@1.0.4
minifier-css@1.1.13 minifier-css@1.2.14
minifier-js@1.1.13 minifier-js@1.2.14
minimongo@1.0.17 minimongo@1.0.17
mobile-experience@1.0.4 mobile-experience@1.0.4
mobile-status-bar@1.0.12 mobile-status-bar@1.0.12
modules@0.6.5 modules@0.7.6
modules-runtime@0.6.5 modules-runtime@0.7.6
mongo@1.1.9_1 mongo@1.1.12
mongo-id@1.0.5 mongo-id@1.0.5
mquandalle:bower@1.5.2_1 mquandalle:bower@1.5.2_1
npm-mongo@1.4.45 npm-mongo@1.5.49
observe-sequence@1.0.12 observe-sequence@1.0.12
ordered-dict@1.0.8 ordered-dict@1.0.8
promise@0.7.3 promise@0.8.4
random@1.0.10 random@1.0.10
reactive-dict@1.1.8 reactive-dict@1.1.8
reactive-var@1.0.10 reactive-var@1.0.10
...@@ -59,19 +59,20 @@ reload@1.1.10 ...@@ -59,19 +59,20 @@ reload@1.1.10
retry@1.0.8 retry@1.0.8
routepolicy@1.0.11 routepolicy@1.0.11
session@1.1.6 session@1.1.6
shell-server@0.2.1
spacebars@1.0.12 spacebars@1.0.12
spacebars-compiler@1.0.12 spacebars-compiler@1.0.12
standard-minifier-css@1.0.8 standard-minifier-css@1.2.0
standard-minifier-js@1.0.8 standard-minifier-js@1.2.0
templating@1.1.13 templating@1.2.14
templating-tools@1.0.4 templating-tools@1.0.4
tracker@1.0.14 tracker@1.1.0
ui@1.0.11 ui@1.0.11
underscore@1.0.9 underscore@1.0.9
url@1.0.10 url@1.0.10
webapp@1.2.10 webapp@1.3.11
webapp-hashing@1.0.9 webapp-hashing@1.0.9
zodiase:check@0.0.4 zodiase:check@0.0.4
zodiase:material-design-icons-fonts@2.2.1 zodiase:material-design-icons-fonts@2.2.3
zodiase:mdl@1.1.2_2 zodiase:mdl@1.2.0
zodiase:mdl-assets@1.1.2_1 zodiase:mdl-assets@1.2.0_1
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="description" content="SRCT Weather beautifully displays live weather and forecasts for Mason's campuses."> <meta name="description" content="SRCT Weather beautifully displays live weather and forecasts for Mason's campuses.">
<title>SRCT Weather - 76&#176; F</title> <title>SRCT Weather &bull; 76&#176; F</title>
<link rel="stylesheet" href="weather.css"> <link rel="stylesheet" href="weather.css">
<link rel="icon" type="image/x-icon" href="lib/favicon.ico" />
</head> </head>
// client entry point, imports all client code
import { Template } from 'meteor/templating';
import '../imports/ui/body.js';
import './main.html';
"use strict";
import { Mongo } from 'meteor/mongo';
export const WeatherData = new Mongo.Collection('weather-data');
export function refreshData() {
for(var key in LOCATIONS) {
const current = LOCATIONS[key];
var currentData
Meteor.call('weatherDataForLoc', current.lat, current.long, function(err, res){
currentData = res
});
WeatherData.insert ({
name: current.name,
lat: current.lat,
long: current.long,
data: currentData,
lastUpdated: new Date(),
});
}
}
// Static dict of GMU Campus locations
LOCATIONS = { LOCATIONS = {
FAIRFAX: {name: 'Fairfax', lat: '38.830295', long: '-77.307717'}, FAIRFAX: {name: 'Fairfax', lat: '38.830295', long: '-77.307717'},
ARLINGTON: {name: 'Arlington', lat: '38.885025', long: '-77.101114'}, ARLINGTON: {name: 'Arlington', lat: '38.885025', long: '-77.101114'},
SCITECH: {name: 'SciTech', lat: '38.756211', long: '-77.521461'}, SCITECH: {name: 'SciTech', lat: '38.756211', long: '-77.521461'},
KOREA: {name: 'Mason Korea', lat: '37.367863', long: '126.630984'}//, KOREA: {name: 'Mason Korea', lat: '37.367863', long: '126.630984'}//,
//RAK: {name: 'Mason Ras-Al-Khaimah', lat: '0', long: '0'} NEED LAT AND LONG
}; };
import { Mongo } from 'meteor/mongo';
export const WeatherData = new Mongo.Collection('WeatherDatas');
WeatherData.schema = new SimpleSchema({
name: {
type: String,
label: "The name of the GMU Campus"
},
lat: {
type: Number,
label: "The latitude of the GMU Campus"
},
long: {
type: Number,
label: "The logiute of the GMU Campus"
},
data: {
type: Object,
label: "The most current weather entry for this location"
},
lastUpdated: {
type: Date,
label: "The last time that this campus's current forecast was updated"
}
})
Meteor.methods({
'weatherDataForLoc': function (lat, long) {
// API_KEY is an environmental veriable, you can set it with a JS file in
// server/lib or in your server control panel.
var API_KEY = process.env.API_KEY;
var apiURL = 'https://api.forecast.io/forecast/' + API_KEY + '/' + lat + ',' + long;
var response = HTTP.get(apiURL).data;
return response;
}
});
export function refreshData() {
for(var key in LOCATIONS) {
const current = LOCATIONS[key];
var currentData
Meteor.call('weatherDataForLoc', current.lat, current.long, function(err, res){
currentData = res
});
/**
WeatherData.insert ({
name: current.name,
lat: current.lat,
long: current.long,
data: currentData,
lastUpdated: new Date(),
});
*/
let location = {
name: current.name,
lat: current.lat,
long: current.long,
data: currentData,
lastUpdated: new Date(),
}
WeatherData.schema.validate(location);
WeatherData.insert(location);
}
}
import './body.html';
for(var key in LOCATIONS) {
var current = LOCATIONS[key];
console.log(current.name);
Meteor.call('weatherDataForLoc', current.lat, current.long, function(err, res){
console.log(res);
//Sends the result of the API call to the browser console, will change
});
}
import { Template } from 'meteor/templating';
import { WeatherData } from '../api/data.js';
import '../../client/weather.html';
Template.body.helpers({
current() {
return WeatherData.find({});
},
});
import { WeatherData } from '../imports/api/data.js'; // server entry point, imports all server code
import { Meteor } from 'meteor/meteor';
import { WeatherData } from '../imports/api/weather-data.js';
//import 'imports/ui/dataview.js'; //seems to be the problem?
if (Meteor.isClient) {
for(var key in LOCATIONS) {
var current = LOCATIONS[key];
console.log(current.name);
Meteor.call('weatherDataForLoc', current.lat, current.long, function(err, res){
console.log(res);
//Sends the result of the API call to the browser console, will change
});
}
Template.weather.helpers({
updateData: function() {
}
});
Template.weather.events({
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
});
Meteor.methods({
'weatherDataForLoc': function (lat, long) {
//API_KEY is an environmental veriable, you can set it with a JS file in
// server/lib or in your server control panel.
var API_KEY = process.env.API_KEY;
var apiURL = 'https://api.darksky.net/forecast/' + API_KEY + '/' + lat + ',' + long;
var response = HTTP.get(apiURL).data;
return response;
}
});
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment