-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cc2dc19
Showing
10 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This file contains information which helps Meteor properly upgrade your | ||
# app when you run 'meteor update'. You should check it into version control | ||
# with your project. | ||
|
||
notices-for-0.9.0 | ||
notices-for-0.9.1 | ||
0.9.4-platform-file | ||
notices-for-facebook-graph-api-2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This file contains a token that is unique to your project. | ||
# Check it into your repository along with the rest of this directory. | ||
# It can be used for purposes such as: | ||
# - ensuring you don't accidentally deploy one app on top of another | ||
# - providing package authors with aggregated statistics | ||
|
||
15t0uap9rqet5v0vxpk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Meteor packages used by this project, one per line. | ||
# Check this file (and the other files in this directory) into your repository. | ||
# | ||
# 'meteor add' and 'meteor remove' will edit this file for you, | ||
# but you can also edit it by hand. | ||
|
||
meteor-platform | ||
autopublish | ||
insecure | ||
http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
server | ||
browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* CSS declarations go here */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<head> | ||
<title>The Spotify Game - Meteor Version</title> | ||
</head> | ||
|
||
<body> | ||
|
||
{{> hello}} | ||
</body> | ||
|
||
<template name='hello'> | ||
<h1>The Spotify Game</h1> | ||
<h2 class='start'>Click Here to return 8 similar artists</h2> | ||
<h2 class='currentArtist'></h2> | ||
<input type='text' placeholder='Enter an artist name' class='inputArtist'> | ||
<ul class='artists'> | ||
|
||
</ul> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
if (Meteor.isClient) { | ||
|
||
|
||
Template.hello.helpers({ | ||
}); | ||
|
||
Template.hello.events({ | ||
'click h2.start': function () { | ||
// when h2 is clicked | ||
inputArtist = $('input.inputArtist').val(); | ||
HTTP.get('http://developer.echonest.com/api/v4/artist/profile?api_key=X2VQTSJP3SIFYYMVT&id=7digital-US:artist:' + inputArtist + '&format=json', | ||
{}, | ||
function (error, result) { | ||
if (result.statusCode === 200) { | ||
$('h2.currentArtist').empty().append(result.data.response.artist.name); | ||
|
||
} | ||
}); | ||
|
||
HTTP.get('http://developer.echonest.com/api/v4/artist/similar?api_key=X2VQTSJP3SIFYYMVT&id=7digital-US:artist:' + inputArtist + '&format=json&results=8&start=0', | ||
{}, | ||
function (error, result) { | ||
if (result.statusCode === 200) { | ||
$('ul.artists').empty(); | ||
//clear the list each click | ||
for (var i = 0; i < result.data.response.artists.length; i++) { | ||
//append artists to unordered list | ||
$('ul.artists').append('<li>' + result.data.response.artists[i].name + '</li>') | ||
} | ||
} | ||
} | ||
); | ||
}, | ||
'click li': function (event) { | ||
event.preventDefault(); | ||
///get the text of the clicked artist | ||
nextArtist = $(event.target).text(); | ||
|
||
HTTP.get('http://developer.echonest.com/api/v4/artist/similar?api_key=X2VQTSJP3SIFYYMVT&id=7digital-US:artist:' + nextArtist + '&format=json&results=8&start=0', | ||
{}, | ||
function (error, result) { | ||
if (result.statusCode === 200) { | ||
$('ul.artists').empty(); | ||
//clear the list each click | ||
for (var i = 0; i < result.data.response.artists.length; i++) { | ||
//append 8 artists to the unordered list | ||
$('ul.artists').append('<li>' + result.data.response.artists[i].name + '</li>') | ||
} | ||
} | ||
} | ||
); | ||
$('h2.currentArtist').empty().append(nextArtist); | ||
var currentArtist = $('h2.currentArtist').html(); | ||
console.log('current artist is: ' + currentArtist); | ||
var targetArtist = Math.floor((Math.random() * 100) + 1); | ||
console.log('target artist is: ' + targetArtist); | ||
if (currentArtist == targetArtist) { | ||
alert("ZOMG YOU WIN!!!") | ||
} | ||
} | ||
}); | ||
} | ||
|
||
if (Meteor.isServer) { | ||
Meteor.startup(function () { | ||
// code to run on server at startup | ||
}); | ||
} |