-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
55 lines (48 loc) · 1.07 KB
/
Copy pathserver.js
File metadata and controls
55 lines (48 loc) · 1.07 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
'use strict';
var express = require('express');
var app = express();
var request = require('request');
setInterval(function(){
request.post(
'https://graph.facebook.com',
{
json: {
id: "https://gif-elixir.herokuapp.com/",
scrape: true
}
},
function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body)
}
}
);
}, 2000);
setInterval(function(){
request.post(
'https://graph.facebook.com',
{
json: {
id: "http://bit.ly/b-a-r-b-a",
scrape: true
}
},
function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body)
}
}
);
}, 2000);
app.engine('.html', require('ejs').__express);
app.set('views', __dirname + '/views');
app.set('view engine', 'html');
app.get('/', function(req, res){
var random = Math.floor((Math.random() * 18) + 6);
res.render('index', {
gif: random+""
});
});
app.use('/', express.static('views'));
app.listen(process.env.PORT || 5000, function () {
});