Skip to content

Commit

Permalink
Updated tweet parameters to match Jake's gist (plus my addition to it).
Browse files Browse the repository at this point in the history
  • Loading branch information
joelspadin committed Mar 1, 2012
1 parent 6957e19 commit 0c0ea2f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 16 deletions.
1 change: 1 addition & 0 deletions index.html
Expand Up @@ -20,6 +20,7 @@

<script src="js/libs/modernizr-2.5.2.min.js"></script>
<script src="http://platform.twitter.com/anywhere.js?id=Lkfowim2PDqHI1XGrXg5Yw&v=1"></script>
<!-- update this with the real location of the node server -->
<script src="http://localhost:8080/socket.io/socket.io.js"></script>

<link rel="shortcut icon" href="images/favicon.ico">
Expand Down
18 changes: 13 additions & 5 deletions js/main.js
@@ -1,5 +1,5 @@

var useTestValues = true;
var useTestValues = false;

// Hardcoded sequences for testing. Use array of 16 0's for production
var sequence = {
Expand Down Expand Up @@ -236,31 +236,39 @@ $(document).ready(function() {

var firstUpdate = true;

// If an instrument has 2x the resolution of other instruments,
// set its subdivision to 2.

renderers.melody = new SequenceRenderer($('#melody').get(0));
renderers.melody.colors.note = '#9aa641';

renderers.bass = new SequenceRenderer($('#bass').get(0));
renderers.bass.colors.note = '#a82934';

renderers.snare = new RhythmRenderer($('#snare').get(0));
renderers.snare.joinBottom = true;

renderers.bassdrum = new RhythmRenderer($('#bassdrum').get(0));
renderers.bassdrum.joinTop = true;
renderers.bassdrum.joinBottom = true;

renderers.hihat = new RhythmRenderer($('#hihat').get(0));
renderers.hihat.joinTop = true;
renderers.hihat.subdivision = 2;

renderers.snare.colors.note = renderers.bassdrum.colors.note
= renderers.hihat.colors.note = '#3d89a0';

renderAll();

buildParams();

if (useTestValues) {
var testTweet = {
avatar: 'https://twimg0-a.akamaihd.net/profile_images/426806419/Kana_reasonably_small.png',
name: 'Joel Spadin',
userimgurl: 'https://twimg0-a.akamaihd.net/profile_images/426806419/Kana_reasonably_small.png',
displayname: 'Joel Spadin',
username: 'ChaosinaCan',
text: '@sigumusicuiuc, blah blah blah blah blah. Testing testing, blah blah blah blah blah. Testing testing, blah blah blah blah blah. 140 reached',
raw_input: '@sigumusicuiuc, blah blah blah blah blah. Testing testing, blah blah blah blah blah. Testing testing, blah blah blah blah blah. 140 reached',
url: 'http://google.com',
params: {
'Failness': 4,
'Awesome': -6,
Expand Down
11 changes: 6 additions & 5 deletions js/twitter.js
Expand Up @@ -35,14 +35,15 @@ function resizeTweetBox() {


function addTweet(tweet, noAnim) {
var avatar = tweet.avatar;
var name = tweet.name;
var username = tweet.username;
var text = tweet.text;
console.log(tweet);
var avatar = tweet.userimgurl || null;
var username = tweet.username || '<no username>';
var name = tweet.displayname || username;
var text = tweet.raw_input || '<no text>';
var params = tweet.params || {};

var profile = 'https://twitter.com/#!/' + username;
var link = tweet.link || profile;
var link = tweet.url || profile;

// build the tweet
var item = $('<article>').append(
Expand Down
17 changes: 11 additions & 6 deletions node/main.js
Expand Up @@ -9,14 +9,19 @@
*
* [
* {
* "name": "User display name",
* "displayname": "User display name",
* "username": "The @username, but without the @.",
* "avatar": "URL of the display picture",
* "link": "Optional: a link to the specific tweet",
* "text": "The text in the tweet"
* "userimgurl": "URL of the display picture",
* "url": "Optional: a link to the specific tweet",
* "raw_input": "The text in the tweet",
* "params":
* {
* "Param 1": 4,
* "Param 2": -2
* }
* },
* { ... },
* { ... }
* { another tweet },
* { and so on... }
* ]
*
*
Expand Down

0 comments on commit 0c0ea2f

Please sign in to comment.