Remove old rimgu code
This commit is contained in:
parent
a13a064547
commit
d96e0768bc
|
@ -1,11 +0,0 @@
|
||||||
export default {
|
|
||||||
port: process.env.RIMGU_PORT || 8080,
|
|
||||||
host: process.env.RIMGU_HOST || 'localhost',
|
|
||||||
address: process.env.RIMGU_ADDRESS || '127.0.0.1',
|
|
||||||
http_proxy: process.env.RIMGU_HTTP_PROXY || null,
|
|
||||||
https_proxy: process.env.RIMGU_HTTPS_PROXY || null,
|
|
||||||
imgur_client_id: process.env.RIMGU_IMGUR_CLIENT_ID || null,
|
|
||||||
use_api: process.env.RIMGU_USE_API && process.env.RIMGU_USE_API !== 'false',
|
|
||||||
page_title: process.env.RIMGU_PAGE_TITLE || 'rimgu',
|
|
||||||
debug: process.env.RIMGU_DEBUG && process.env.RIMGU_DEBUG !== 'false',
|
|
||||||
};
|
|
|
@ -1,143 +0,0 @@
|
||||||
interface Account {
|
|
||||||
id: number;
|
|
||||||
username: string;
|
|
||||||
avatar_url: string;
|
|
||||||
created_at: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
type MediaMimeType = 'image/jpeg' | 'image/png' | 'image/gif';
|
|
||||||
type MediaType = 'image';
|
|
||||||
type MediaExt = 'jpeg' | 'png' | 'gif';
|
|
||||||
type Sorting = 'newest' | 'oldest' | 'best' | 'viral';
|
|
||||||
|
|
||||||
interface Tag {
|
|
||||||
tag: string;
|
|
||||||
display: string;
|
|
||||||
background_id: string;
|
|
||||||
accent: string;
|
|
||||||
is_promoted: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Media {
|
|
||||||
id: string;
|
|
||||||
account_id: number;
|
|
||||||
mime_type: MediaMimeType;
|
|
||||||
type: MediaType;
|
|
||||||
name: string;
|
|
||||||
basename: string;
|
|
||||||
url: string;
|
|
||||||
ext: MediaExt;
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
size: number;
|
|
||||||
metadata: {
|
|
||||||
title: string;
|
|
||||||
description: string;
|
|
||||||
is_animated: boolean;
|
|
||||||
is_looping: boolean;
|
|
||||||
duration: number;
|
|
||||||
has_sound: boolean;
|
|
||||||
},
|
|
||||||
created_at: string;
|
|
||||||
updated_at: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
type MediaPlatform = 'ios' | 'android' | 'api' | 'web';
|
|
||||||
interface Comment {
|
|
||||||
id: number;
|
|
||||||
parent_id: number;
|
|
||||||
comment: string;
|
|
||||||
account_id: number;
|
|
||||||
post_id: string;
|
|
||||||
upvote_count: number;
|
|
||||||
downvote_count: number;
|
|
||||||
point_count: number;
|
|
||||||
vote: null; // ?
|
|
||||||
platform_id: number;
|
|
||||||
platform: MediaPlatform;
|
|
||||||
created_at: string;
|
|
||||||
updated_at: string;
|
|
||||||
deleted_at: null;
|
|
||||||
next: null; //?
|
|
||||||
comments: Comment[];
|
|
||||||
account: {
|
|
||||||
id: number;
|
|
||||||
username: string;
|
|
||||||
avatar: string;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Gallery {
|
|
||||||
id: string;
|
|
||||||
title: string;
|
|
||||||
account: Account;
|
|
||||||
media: Media[];
|
|
||||||
tags: Tag[];
|
|
||||||
cover: Media;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PostTag {
|
|
||||||
name: string;
|
|
||||||
display_name: string;
|
|
||||||
followers: number;
|
|
||||||
total_items: number;
|
|
||||||
following: boolean;
|
|
||||||
is_whitelisted: boolean;
|
|
||||||
background_hash: string;
|
|
||||||
thumbnail_hash: string;
|
|
||||||
accent: string;
|
|
||||||
background_is_animated: boolean;
|
|
||||||
thumbnail_is_animated: boolean;
|
|
||||||
is_promoted: boolean;
|
|
||||||
description: string;
|
|
||||||
logo_hash: string;
|
|
||||||
logo_destination_url: string;
|
|
||||||
description_annotations: {}
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Post {
|
|
||||||
id: string;
|
|
||||||
account_id: number;
|
|
||||||
type: MediaMimeType;
|
|
||||||
animated: boolean;
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
size: number;
|
|
||||||
views: number;
|
|
||||||
bandwidth: number;
|
|
||||||
vote: null;
|
|
||||||
favorite: boolean;
|
|
||||||
nsfw: boolean;
|
|
||||||
section: string;
|
|
||||||
account_url: string;
|
|
||||||
is_ad: boolean;
|
|
||||||
in_most_viral: boolean;
|
|
||||||
has_sound: boolean;
|
|
||||||
tags: PostTag[];
|
|
||||||
link: string;
|
|
||||||
comment_count: number;
|
|
||||||
ups: number;
|
|
||||||
downs: number;
|
|
||||||
score: number;
|
|
||||||
points: number;
|
|
||||||
is_album: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TagResult extends PostTag {
|
|
||||||
items: Post[];
|
|
||||||
success: boolean;
|
|
||||||
status: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface UserResult {
|
|
||||||
id: number;
|
|
||||||
username: string;
|
|
||||||
bio: string;
|
|
||||||
reputation_count: number;
|
|
||||||
reputation_name: string;
|
|
||||||
avatar_id: string;
|
|
||||||
avatar_url: string;
|
|
||||||
cover_id: string;
|
|
||||||
cover_url: string;
|
|
||||||
created_at: string;
|
|
||||||
}
|
|
11
src/util.ts
11
src/util.ts
|
@ -1,11 +0,0 @@
|
||||||
export const proxyURL = (url: string): string =>
|
|
||||||
url.replace(/^https?:\/\/[^.]*\.imgur.com\//, '/');
|
|
||||||
|
|
||||||
export const linkify = (content: string) =>
|
|
||||||
content.replace(
|
|
||||||
/https?:\/\/[^.]*\.imgur.com\/([\/_a-zA-Z0-9-]+)\.(gifv|mp4)/g,
|
|
||||||
'<video src="/$1.mp4" class="commentVideo commentObject" loop="" autoplay="" controls=""></video>'
|
|
||||||
).replace(
|
|
||||||
/https?:\/\/[^.]*\.imgur.com\/([\/_a-zA-Z0-9-]+\.[a-z0-9A-Z]{2,6})/g,
|
|
||||||
'<a href="/$1" target="_blank"><img class="commentImage commentObject" src="/$1" loading="lazy" /></a>'
|
|
||||||
);
|
|
Loading…
Reference in New Issue