summaryrefslogtreecommitdiffstats
path: root/src/services/jobs.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/jobs.ts')
-rw-r--r--src/services/jobs.ts22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/services/jobs.ts b/src/services/jobs.ts
index cf3b894..354c66d 100644
--- a/src/services/jobs.ts
+++ b/src/services/jobs.ts
@@ -1,8 +1,18 @@
1import * as e621 from "../api/e621"; 1import * as e621 from "../api/e926";
2import * as mastodon from "../api/mastodon"; 2import * as mastodon from "../api/mastodon";
3import config from "../config"; 3import config from "../config";
4import Sharp from "sharp"; 4import Sharp from "sharp";
5 5
6export async function postSpecificPicture(id: number) {
7 console.log(`Fetching post ${id}...`);
8
9 const post = await e621.getPostById(id);
10
11 console.log(`Got ${post.id}`);
12
13 await handlePost(post);
14}
15
6export async function postRandomPicture() { 16export async function postRandomPicture() {
7 console.log("Fetching random post..."); 17 console.log("Fetching random post...");
8 18
@@ -15,16 +25,6 @@ export async function postRandomPicture() {
15 await handlePost(post); 25 await handlePost(post);
16} 26}
17 27
18export async function postSpecificPicture(id: number) {
19 console.log(`Fetching post ${id}...`);
20
21 const post = await e621.getPostById(id);
22
23 console.log(`Got ${post.id}`);
24
25 await handlePost(post);
26}
27
28async function handlePost(post: e621.Post) { 28async function handlePost(post: e621.Post) {
29 const source = post.sources.length ? post.sources[0] : undefined; 29 const source = post.sources.length ? post.sources[0] : undefined;
30 const cws = config.cw.filter((w) => post.tags.general.includes(w)); 30 const cws = config.cw.filter((w) => post.tags.general.includes(w));