forked from CodingTrain/website-archive
-
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
Showing
301 changed files
with
327 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 |
---|---|---|
@@ -1 +1,3 @@ | ||
.DS_Store | ||
config.js | ||
node_modules |
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 @@ | ||
|
||
console.log("Hello aribitrary video website"); |
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,20 @@ | ||
console.log('The bot is starting'); | ||
|
||
var Twit = require('twit'); | ||
|
||
var config = require('./config'); | ||
var T = new Twit(config); | ||
|
||
var params = { | ||
q: 'rainbow', | ||
count: 2 | ||
} | ||
|
||
T.get('search/tweets', params, gotData); | ||
|
||
function gotData(err, data, response) { | ||
var tweets = data.statuses; | ||
for (var i = 0; i < tweets.length; i++) { | ||
console.log(tweets[i].text); | ||
} | ||
} |
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,12 @@ | ||
// Change this file to config.js | ||
// Add your keys | ||
// Add file .gitignore: config.js | ||
// Load with | ||
// var config = require('./config.js'); | ||
|
||
module.exports = { | ||
consumer_key: '', | ||
consumer_secret: '', | ||
access_token: '', | ||
access_token_secret: '' | ||
} |
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,19 @@ | ||
{ | ||
"name": "npm_demo", | ||
"version": "1.0.0", | ||
"description": "I am demonstrating npm.", | ||
"main": "bot.js", | ||
"scripts": { | ||
"start": "node bot.js", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [ | ||
"rainbow", | ||
"awkward" | ||
], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"twit": "^2.1.1" | ||
} | ||
} |
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,21 @@ | ||
console.log('The bot is starting'); | ||
|
||
var Twit = require('twit'); | ||
|
||
var config = require('./config'); | ||
var T = new Twit(config); | ||
|
||
|
||
var tweet = { | ||
status: '#codingrainbow from node.js' | ||
} | ||
|
||
T.post('statuses/update', tweet, tweeted); | ||
|
||
function tweeted(err, data, response) { | ||
if (err) { | ||
console.log("Something went wwrong!"); | ||
} else { | ||
console.log("It worked!"); | ||
} | ||
} |
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,12 @@ | ||
// Change this file to config.js | ||
// Add your keys | ||
// Add file .gitignore: config.js | ||
// Load with | ||
// var config = require('./config.js'); | ||
|
||
module.exports = { | ||
consumer_key: '', | ||
consumer_secret: '', | ||
access_token: '', | ||
access_token_secret: '' | ||
} |
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,19 @@ | ||
{ | ||
"name": "npm_demo", | ||
"version": "1.0.0", | ||
"description": "I am demonstrating npm.", | ||
"main": "bot.js", | ||
"scripts": { | ||
"start": "node bot.js", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [ | ||
"rainbow", | ||
"awkward" | ||
], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"twit": "^2.1.1" | ||
} | ||
} |
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,28 @@ | ||
console.log('The bot is starting'); | ||
|
||
var Twit = require('twit'); | ||
|
||
var config = require('./config'); | ||
var T = new Twit(config); | ||
|
||
tweetIt(); | ||
setInterval(tweetIt, 1000*20); | ||
|
||
function tweetIt() { | ||
|
||
var r = Math.floor(Math.random()*100); | ||
|
||
var tweet = { | ||
status: 'random number ' + r + ' #codingrainbow' | ||
} | ||
|
||
T.post('statuses/update', tweet, tweeted); | ||
|
||
function tweeted(err, data, response) { | ||
if (err) { | ||
console.log("Something went wwrong!"); | ||
} else { | ||
console.log("It worked!"); | ||
} | ||
} | ||
} |
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,12 @@ | ||
// Change this file to config.js | ||
// Add your keys | ||
// Add file .gitignore: config.js | ||
// Load with | ||
// var config = require('./config.js'); | ||
|
||
module.exports = { | ||
consumer_key: '', | ||
consumer_secret: '', | ||
access_token: '', | ||
access_token_secret: '' | ||
} |
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,19 @@ | ||
{ | ||
"name": "npm_demo", | ||
"version": "1.0.0", | ||
"description": "I am demonstrating npm.", | ||
"main": "bot.js", | ||
"scripts": { | ||
"start": "node bot.js", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [ | ||
"rainbow", | ||
"awkward" | ||
], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"twit": "^2.1.1" | ||
} | ||
} |
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,37 @@ | ||
console.log('The follow bot is starting'); | ||
|
||
var Twit = require('twit'); | ||
|
||
var config = require('./config'); | ||
var T = new Twit(config); | ||
|
||
// Setting up a user stream | ||
var stream = T.stream('user'); | ||
|
||
// Anytime someone follows me | ||
stream.on('follow', followed); | ||
|
||
function followed(eventMsg) { | ||
console.log("Follow event!"); | ||
var name = eventMsg.source.name; | ||
var screenName = eventMsg.source.screen_name; | ||
tweetIt('.@' + screenName + ' do you like rainbows?'); | ||
} | ||
|
||
|
||
function tweetIt(txt) { | ||
|
||
var tweet = { | ||
status: txt | ||
} | ||
|
||
T.post('statuses/update', tweet, tweeted); | ||
|
||
function tweeted(err, data, response) { | ||
if (err) { | ||
console.log("Something went wwrong!"); | ||
} else { | ||
console.log("It worked!"); | ||
} | ||
} | ||
} |
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,12 @@ | ||
// Change this file to config.js | ||
// Add your keys | ||
// Add file .gitignore: config.js | ||
// Load with | ||
// var config = require('./config.js'); | ||
|
||
module.exports = { | ||
consumer_key: '', | ||
consumer_secret: '', | ||
access_token: '', | ||
access_token_secret: '' | ||
} |
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,19 @@ | ||
{ | ||
"name": "npm_demo", | ||
"version": "1.0.0", | ||
"description": "I am demonstrating npm.", | ||
"main": "bot.js", | ||
"scripts": { | ||
"start": "node bot.js", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [ | ||
"rainbow", | ||
"awkward" | ||
], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"twit": "^2.1.1" | ||
} | ||
} |
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,46 @@ | ||
console.log('The image bot is starting'); | ||
|
||
var Twit = require('twit'); | ||
|
||
var config = require('./config'); | ||
|
||
var T = new Twit(config); | ||
|
||
var exec = require('child_process').exec; | ||
var fs = require('fs'); | ||
|
||
tweetIt(); | ||
// setInterval(tweetIt, 1000*20); | ||
|
||
function tweetIt() { | ||
var cmd = 'processing-java --sketch=`pwd`/rainbow --run'; | ||
exec(cmd, processing); | ||
|
||
function processing() { | ||
var filename = 'rainbow/output.png'; | ||
var params = { | ||
encoding: 'base64' | ||
} | ||
var b64 = fs.readFileSync(filename, params); | ||
|
||
T.post('media/upload', { media_data: b64 }, uploaded); | ||
|
||
function uploaded(err, data, response) { | ||
var id = data.media_id_string; | ||
var tweet = { | ||
status: '#codingrainbow live from node.js', | ||
media_ids: [id] | ||
} | ||
T.post('statuses/update', tweet, tweeted); | ||
|
||
} | ||
|
||
function tweeted(err, data, response) { | ||
if (err) { | ||
console.log("Something went wwrong!"); | ||
} else { | ||
console.log("It worked!"); | ||
} | ||
} | ||
} | ||
} |
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,12 @@ | ||
// Change this file to config.js | ||
// Add your keys | ||
// Add file .gitignore: config.js | ||
// Load with | ||
// var config = require('./config.js'); | ||
|
||
module.exports = { | ||
consumer_key: '', | ||
consumer_secret: '', | ||
access_token: '', | ||
access_token_secret: '' | ||
} |
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,19 @@ | ||
{ | ||
"name": "npm_demo", | ||
"version": "1.0.0", | ||
"description": "I am demonstrating npm.", | ||
"main": "bot.js", | ||
"scripts": { | ||
"start": "node bot.js", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [ | ||
"rainbow", | ||
"awkward" | ||
], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"twit": "^2.1.1" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,16 @@ | ||
|
||
void setup() { | ||
size(640, 360); | ||
background(51); | ||
for (int i = 0; i < 5000; i++) { | ||
float x = random(width); | ||
float y = random(height); | ||
float r = random(100, 255); | ||
float b = random(100, 255); | ||
noStroke(); | ||
fill(r, 0, b, 100); | ||
ellipse(x, y, 16, 16); | ||
} | ||
save("output.png"); | ||
exit(); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.