Skip to content

Instantly share code, notes, and snippets.

View elizabethsiegle's full-sized avatar
👩‍💻

Lizzie Siegle elizabethsiegle

👩‍💻
View GitHub Profile
@elizabethsiegle
elizabethsiegle / Random HarryPotter Quote Generator - Zipline.markdown
Created November 29, 2015 01:00
Random HarryPotter Quote Generator - Zipline
var channel = 'pubnub-twitter';
var pubnubTweet = PUBNUB.init({
subscribe_key: 'sub-c-78806dd4-42a6-11e4-aed8-02ee2ddab7fe',
ssl: true
});
<div class="container"></div>
<div class="container">
<div id="selDiv">
<h4 id="bestFans">Which fans are Tweeting more?</h4>
</div>
<div id="scrollDiv"></div>
<div id="scrollDivPic"></div>
</div>
function getStreamData() {
pubnubTweet.subscribe({
channel: channel,
callback: processData
});
}
var curryWords = [
'stephen curry', 'chef curry', '#stephcurry', '#chefcurry', ‘curry’
]
var splashWords = [
'splash brothers', 'splash bros', 'splash'
]
var numCurryWords = 0;
var numSplashWords = 0;
function bestFans() {
var fanElement = document.getElementById('scrollDiv');
var fanStr = document.createTextNode('Warriors fans are Tweeting more');
var notFanStr = document.createTextNode('Cleveland fans are Tweeting more');
var tieFanStr = document.createTextNode('Both teams\' fans are tweeting equally!');
if (numDubsTeamWords == numCavsTeamWords) {
fanElement.innerHTML = tieFanStr;
fanElement.appendChild(tieFanStr);
} //if
var pubnubEon = PUBNUB.init({
subscribe_key: 'your-sub-key',
publish_key: 'your-pub-key'
});
eon.chart({
channel: nbaChannel,
pubnub: pubnubEon,
debug: true,
generate: {
bindto: '#chart',
data: {
labels: true,
type: 'donut',
colors: {
var nbaChannel = 'NBAChannel';
function publish2() {
pubnubEon.publish({
channel: nbaChannel,
message: {
eon: {
"Splash Bros" : numSplashWords/totalNumTweets,
"Curry" : numCurryWords/totalNumTweets,
"Green" : numDraymondWords/totalNumTweets,