This repository was archived by the owner on Apr 17, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
84 lines (70 loc) · 3.53 KB
/
Copy pathindex.js
File metadata and controls
84 lines (70 loc) · 3.53 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import axios from 'axios';
import 'dotenv/config'; /* load dotenv */
var user = process.env.user;
var token = process.env.token;
var token2 = process.env.token2; /* second token part lol bliish changed their api */
var time = 3600000
const globalposts = "https://bliish.com/api/v1/posts"
const wallposts = `https://bliish.com/api/v1/profiles/${user}/wall/posts`
const wall = "https://bliish.com/api/v1/profiles/snapple/wall?fresh=1&limit=20"
const facts = [
"Snapple Real Fact #408: Panda bears eat up to 16 hours a day.",
"Snapple Real Fact #2143: The first golf course in America was built in 1884 in West Virginia.",
"Snapple Real Fact #123: The average person spends about six months of their life waiting for red lights to turn green.",
"Snapple Real Fact #567: The world's largest snowflake on record was 15 inches wide and 8 inches thick.",
"Snapple Real Fact #789: The shortest war in history lasted only 38 minutes between Britain and Zanzibar in 1896.",
"Snapple Real Fact #321: The average person has about 100,000 hairs on their head.",
"Snapple Real Fact #654: The longest recorded flight of a chicken is 13 seconds.",
"Snapple Real Fact #987: The human nose can remember 50,000 different scents.",
"Snapple Real Fact #432: The world's largest rubber band ball weighs over 9,000 pounds.",
`Snapple Real Fact #2145: The name April comes from the Latin word "aperire" which means "to open", since April is the month trees and flowers begin to bloom.`,
`Snapple Real Fact #1334: Nowhere in the Humpty Dumpty Nursery Rhyme does it say that Humpty Dumpty is an egg.`,
"Snapple Real Fact #2138: The first St. Patrick's Day Parade was held in Florida over 400 years ago in March of 1601.",
"Snapple Real Fact #1925: Saint Lucia is the only country in the world named after a woman.",
"Snapple Real Fact #5678: The world's largest snowflake on record was 15 inches wide and 8 inches thick.",
"Snapple Real Fact #4321: The average person has about 100,000 hairs on their head.",
"Snapple Real Fact #8765: The longest recorded flight of a chicken is 13 seconds.",
"Snapple Real Fact #5432: The human nose can remember 50,000 different scents.",
"Snapple Real Fact #6789: The world's largest rubber band ball weighs over 9,000 pounds.",
"Snapple Real Fact #6: A honey bee can fly at 15 miles per hour."
];
const random = facts[Math.floor(Math.random() * facts.length)];
var push = {"body": `${random}`}
function check(){
return axios.get(wall, {
headers: {
'cookie': 'sb-prkqirdzadljdpkrvjvz-auth-token.0=' + token + '; sb-prkqirdzadljdpkrvjvz-auth-token.1=' + token2,
'origin': 'https://bliish.com'
}
})
.then(response => {
var data = response.data.posts[0].created_at;
var posttime = new Date(data).getTime();
if (Date.now() - posttime < time) {
console.log("post is less than an hour, not posting new fact :(");
return false;
}
console.log('we be ballin, ready to post')
return true;
console.log('cool status', response.status);
console.log('data we be recieiving', response.data);
})}
function dailyPost(){
return axios.post(globalposts, push, {
headers: {
'cookie': 'sb-prkqirdzadljdpkrvjvz-auth-token.0=' + token + '; sb-prkqirdzadljdpkrvjvz-auth-token.1=' + token2,
'origin': 'https://bliish.com'
}})
.then(response => {
console.log('cool status', response.status);
console.log('data we be sendin', response.data);
console.log('random fact is', random);
})
}
function tryPost() {
check().then(testpost => {
if (testpost) dailyPost();
});
}
tryPost();
setInterval(tryPost, time);