feat: Add platform adapters for various content publishing platforms
- Implemented Dongchedi adapter for user detection and publishing. - Implemented Jianshu adapter for user detection and publishing. - Implemented Juejin adapter for user detection and publishing. - Implemented Qiehao adapter for user detection and publishing. - Implemented Smzdm adapter for user detection and publishing. - Implemented Sohuhao adapter for user detection and publishing. - Implemented Toutiaohao adapter for user detection and publishing. - Implemented Wangyihao adapter for user detection and publishing. - Implemented Weixin Gzh adapter for user detection and publishing. - Implemented Zol adapter for user detection and publishing. - Added documentation for manual testing of media publishing.
This commit is contained in:
@@ -1,9 +1,37 @@
|
||||
import type { StoredPlatformState } from "../platforms";
|
||||
|
||||
import type { AdapterContext, PlatformAdapter, PlatformPublishResult } from "./types";
|
||||
import { baijiahaoAdapter } from "./baijiahao";
|
||||
import { bilibiliAdapter } from "./bilibili";
|
||||
import { dongchediAdapter } from "./dongchedi";
|
||||
import { jianshuAdapter } from "./jianshu";
|
||||
import { juejinAdapter } from "./juejin";
|
||||
import { qiehaoAdapter } from "./qiehao";
|
||||
import { smzdmAdapter } from "./smzdm";
|
||||
import { sohuhaoAdapter } from "./sohuhao";
|
||||
import { toutiaohaoAdapter } from "./toutiaohao";
|
||||
import { wangyihaoAdapter } from "./wangyihao";
|
||||
import { weixinGzhAdapter } from "./weixin_gzh";
|
||||
import { zhihuAdapter } from "./zhihu";
|
||||
import { zolAdapter } from "./zol";
|
||||
|
||||
const adapters = new Map<string, PlatformAdapter>([[zhihuAdapter.platformId, zhihuAdapter]]);
|
||||
const adapters = new Map<string, PlatformAdapter>(
|
||||
[
|
||||
zhihuAdapter,
|
||||
toutiaohaoAdapter,
|
||||
baijiahaoAdapter,
|
||||
sohuhaoAdapter,
|
||||
qiehaoAdapter,
|
||||
jianshuAdapter,
|
||||
bilibiliAdapter,
|
||||
juejinAdapter,
|
||||
wangyihaoAdapter,
|
||||
smzdmAdapter,
|
||||
weixinGzhAdapter,
|
||||
zolAdapter,
|
||||
dongchediAdapter,
|
||||
].map((adapter) => [adapter.platformId, adapter]),
|
||||
);
|
||||
|
||||
export function getPlatformAdapter(platformId: string): PlatformAdapter | undefined {
|
||||
return adapters.get(platformId);
|
||||
|
||||
Reference in New Issue
Block a user