-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtweetBank.js
More file actions
38 lines (30 loc) · 1.16 KB
/
Copy pathtweetBank.js
File metadata and controls
38 lines (30 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var _=require("underscore");
var data=[];
var add = function (name, text) {
data.push({ name: name, text: text });
};
var list = function () {
return _.clone(data);
};
var find = function (properties) {
return _.where(data, properties);
};
module.exports = { add: add, list: list, find: find };
var randArrayEl = function(arr) {
return arr[Math.floor(Math.random() * arr.length)];
};
var getFakeName = function() {
var fakeFirsts = ['Nimit', 'Dave', 'Will', 'Charlotte', 'Jacob','Ethan','Sophia','Emma','Madison'];
var fakeLasts = ["Alley", 'Stacky', 'Fullstackerson', 'Nerd', 'Ashby', 'Gatsby', 'Hazelnut', 'Cookie', 'Tilde', 'Dash'];
return randArrayEl(fakeFirsts) + " " + randArrayEl(fakeLasts);
};
var getFakeTweet = function() {
var awesome_adj = ['awesome','breathtaking','amazing','sexy','sweet','cool','wonderful','mindblowing'];
return "Fullstack Academy is " + randArrayEl(awesome_adj) + "! The instructors are just so " + randArrayEl(awesome_adj) + ". #fullstacklove #codedreams";
};
for(var i=0; i<10; i++) {
module.exports.add( getFakeName(), getFakeTweet() );
console.log(data);
}
//console.log(list());
//console.log(find({name:"Emma Dash"}));