Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Eyad Hasan
weather
Commits
d4b16b79
Commit
d4b16b79
authored
Sep 03, 2016
by
Zach Knox
Browse files
Merge branch 'weather-data'
That versions file...
parents
6e18cca9
19e18742
Changes
12
Show whitespace changes
Inline
Side-by-side
.gitignore
View file @
d4b16b79
...
@@ -2,3 +2,5 @@ weather/mup.json
...
@@ -2,3 +2,5 @@ weather/mup.json
weather/settings.json
weather/settings.json
weather/.meteor
weather/.meteor
weather/server/lib/secrets.js
weather/server/lib/secrets.js
.meteor/local
.meteor/meteorite
weather/.meteor/.finished-upgraders
View file @
d4b16b79
...
@@ -10,3 +10,4 @@ notices-for-facebook-graph-api-2
...
@@ -10,3 +10,4 @@ notices-for-facebook-graph-api-2
1.2.0-meteor-platform-split
1.2.0-meteor-platform-split
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
weather/.meteor/.gitignore
View file @
d4b16b79
dev_bundle
local
local
weather/.meteor/packages
View file @
d4b16b79
...
@@ -12,7 +12,6 @@ session # Client-side reactive dictionary for your app
...
@@ -12,7 +12,6 @@ session # Client-side reactive dictionary for your app
jquery # Helpful client-side library
jquery # Helpful client-side library
tracker # Meteor's client-side reactive programming library
tracker # Meteor's client-side reactive programming library
standard-minifiers # JS/CSS minifiers run for production mode
es5-shim # ECMAScript 5 compatibility for older browsers.
es5-shim # ECMAScript 5 compatibility for older browsers.
ecmascript # Enable ECMAScript2015+ syntax in app code
ecmascript # Enable ECMAScript2015+ syntax in app code
...
@@ -20,3 +19,6 @@ autopublish # Publish all data to the clients (for prototyping)
...
@@ -20,3 +19,6 @@ autopublish # Publish all data to the clients (for prototyping)
insecure # Allow all DB writes from clients (for prototyping)
insecure # Allow all DB writes from clients (for prototyping)
zodiase:mdl
zodiase:mdl
mquandalle:bower
mquandalle:bower
http
standard-minifier-css
standard-minifier-js
weather/.meteor/release
View file @
d4b16b79
METEOR@1.
2.1
METEOR@1.
3.4.4
weather/.meteor/versions
View file @
d4b16b79
<<<<<<< HEAD
autopublish@1.0.4
autopublish@1.0.4
autoupdate@1.2.4
autoupdate@1.2.4
babel-compiler@5.8.24_1
babel-compiler@5.8.24_1
...
...
weather/client/weather.html
View file @
d4b16b79
<body>
<body>
<div
class=
"mdl-layout mdl-js-layout mdl-layout--fixed-header"
>
<div
class=
"mdl-layout mdl-js-layout mdl-layout--fixed-header"
>
<header
class=
"mdl-layout__header"
>
<header
class=
"mdl-layout__header"
>
<div
class=
"mdl-layout__header-row"
>
<div
class=
"mdl-layout__header-row"
>
...
...
weather/imports/api/data.js
0 → 100644
View file @
d4b16b79
"
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
(),
});
}
}
weather/imports/ui/dataview.js
0 → 100644
View file @
d4b16b79
import
{
Template
}
from
'
meteor/templating
'
;
import
{
WeatherData
}
from
'
../api/data.js
'
;
import
'
../../client/weather.html
'
;
Template
.
body
.
helpers
({
current
()
{
return
WeatherData
.
find
({});
},
});
weather/server/lib/secrets.js.template
0 → 100644
View file @
d4b16b79
//Template file for secrets.js
//Duplicate this file and name it 'secrets.js'
//Replace 'YOUR_API_KEY_HERE' with your Forcast.io API key
//You can get an API key at https://developer.forecast.io
Meteor.startup(function () {
process.env.API_KEY = 'YOUR_API_KEY_HERE';
});
weather/server/main.js
0 → 100644
View file @
d4b16b79
import
{
WeatherData
}
from
'
../imports/api/data.js
'
;
weather/weather.js
View file @
d4b16b79
//import 'imports/ui/dataview.js'; //seems to be the problem?
if
(
Meteor
.
isClient
)
{
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
({
Template
.
weather
.
helpers
({
updateData
:
function
()
{
}
});
});
Template
.
weather
.
events
({
Template
.
weather
.
events
({
...
@@ -13,4 +25,15 @@ if (Meteor.isServer) {
...
@@ -13,4 +25,15 @@ if (Meteor.isServer) {
Meteor
.
startup
(
function
()
{
Meteor
.
startup
(
function
()
{
// code to run on server at startup
// 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.forecast.io/forecast/
'
+
API_KEY
+
'
/
'
+
lat
+
'
,
'
+
long
;
var
response
=
HTTP
.
get
(
apiURL
).
data
;
return
response
;
}
});
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment