-
Notifications
You must be signed in to change notification settings - Fork 1
/
tweetBank.js
37 lines (28 loc) · 1.22 KB
/
tweetBank.js
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
const _ = require('lodash');
var data = [];
function add (name, content) {
data.push({ name: name, content: content });
}
function list () {
return _.cloneDeep(data);
}
function find (properties) {
return _.cloneDeep(_.filter(data, properties));
}
module.exports = { add: add, list: list, find: find };
const randArrayEl = function(arr) {
return arr[Math.floor(Math.random() * arr.length)];
};
const getFakeName = function() {
const fakeFirsts = ['Nimit', 'David', 'Shanna', 'Emily', 'Scott', 'Karen', 'Ben', 'Dan', 'Ashi', 'Kate', 'Omri', 'Gabriel', 'Joe', 'Geoff'];
const fakeLasts = ['Hashington', 'Stackson', 'McQueue', 'OLogn', 'Ternary', 'Claujure', 'Dunderproto', 'Binder', 'Docsreader', 'Ecma'];
return randArrayEl(fakeFirsts) + " " + randArrayEl(fakeLasts);
};
const getFakeTweet = function() {
const awesome_adj = ['awesome', 'breathtaking', 'amazing', 'funny', 'sweet', 'cool', 'wonderful', 'mindblowing', 'impressive'];
return "Fullstack Academy is " + randArrayEl(awesome_adj) + "! The instructors are just so " + randArrayEl(awesome_adj) + ". #fullstacklove #codedreams";
};
module.exports.add("Gigi Hoagland", "Test test");
for (let i = 0; i < 10; i++) {
module.exports.add( getFakeName(), getFakeTweet() );
}