diff --git a/.vscode/settings.json b/.vscode/settings.json
index 6ac5e03f..2defe781 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,5 +1,6 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "esbenp.prettier-vscode",
- "editor.formatOnSave": true
+ "editor.formatOnSave": true,
+ "files.autoSave": "off"
}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5ab7b9f3..3509abb5 100755
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,13 @@
All notable changes to this project will be documented in this file.
+### v4.49.0 (2024-10-02)
+
+**Feature**
+
+- Use `Threads` instead of `ZhiHu`.
+- Use `snippets` page instead of `answers` page.
+
### v4.46.0 (2024-09-27)
**Feature**
diff --git a/package.json b/package.json
index 675f54df..2d28e908 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "surmon.me",
- "version": "4.48.0",
+ "version": "4.49.0",
"description": "Surmon.me blog",
"author": "Surmon",
"license": "MIT",
diff --git a/src/bff.ts b/src/bff.ts
index 141d2c5d..096ddea1 100644
--- a/src/bff.ts
+++ b/src/bff.ts
@@ -15,7 +15,12 @@ import { getSitemapXml } from './server/getters/sitemap'
import { getGTagScript } from './server/getters/gtag'
import { getAllWallpapers } from './server/getters/wallpaper'
import { getMyGoogleMap } from './server/getters/my-google-map'
-import { getThreadsProfile, getThreadsMedias, getThreadsMediaChildren } from './server/getters/threads'
+import {
+ getThreadsProfile,
+ getThreadsMedias,
+ getThreadsMediaChildren,
+ getThreadsMediaConversation
+} from './server/getters/threads'
import {
getInstagramProfile,
getInstagramMedias,
@@ -26,7 +31,6 @@ import { getYouTubeChannelPlayLists, getYouTubeVideoListByPlayerListId } from '.
import { getGitHubStatistic, getGitHubSponsors, getGitHubContributions } from './server/getters/github'
import { getNPMStatistic } from './server/getters/npm'
import { getDoubanMovies } from './server/getters/douban'
-import { getZhihuAnswers } from './server/getters/zhihu'
import { getSongList } from './server/getters/netease-music'
import { getWebFont, WebFontContentType } from './server/getters/webfont'
import { enableDevRenderer } from './server/renderer/dev'
@@ -109,28 +113,6 @@ createExpressApp().then(async ({ app, server, cache }) => {
responser(() => get163MusicCache())
)
- // Zhihu first page cache
- const getZhihuFirstPageCache = cacher.interval(cache, {
- key: 'zhihu_answers_offset_0',
- ttl: hours(12),
- interval: hours(3),
- retry: minutes(10),
- getter: getZhihuAnswers
- })
-
- // Zhihu answer route
- app.get(`${TUN}/${TunnelModule.ZhihuAnswers}`, (request, response, next) => {
- const offset = request.query.offset
- if (!!offset && !Number.isInteger(Number(offset))) {
- errorer(response, { code: BAD_REQUEST, message: 'Invalid params' })
- return
- }
-
- responser(() => {
- return offset ? getZhihuAnswers(Number(offset)) : getZhihuFirstPageCache()
- })(request, response, next)
- })
-
// Threads profile
const getThreadsProfileCache = cacher.interval(cache, {
key: TunnelModule.ThreadsProfile,
@@ -190,6 +172,23 @@ createExpressApp().then(async ({ app, server, cache }) => {
})(request, response, next)
})
+ // Threads media conversation
+ app.get(`${TUN}/${TunnelModule.ThreadsMediaConversation}`, (request, response, next) => {
+ const mediaId = request.query.id
+ if (!mediaId || typeof mediaId !== 'string') {
+ errorer(response, { code: BAD_REQUEST, message: 'Invalid params' })
+ return
+ }
+
+ responser(() => {
+ return cacher.passive(cache, {
+ key: `threads_media_conversation_${mediaId}`,
+ ttl: days(7),
+ getter: () => getThreadsMediaConversation(mediaId)
+ })
+ })(request, response, next)
+ })
+
// Instagram profile
app.get(
`${TUN}/${TunnelModule.InstagramProfile}`,
diff --git a/src/config/app.config.ts b/src/config/app.config.ts
index a11e2b03..bdb14f20 100755
--- a/src/config/app.config.ts
+++ b/src/config/app.config.ts
@@ -44,7 +44,6 @@ export const IDENTITIES = Object.freeze({
YOUTUBE_CHANNEL_SHORT_ID: '@surmon_v',
MUSIC_163_BGM_ALBUM_ID: '638949385',
DOUBAN_USER_ID: '56647958',
- ZHIHU_USER_NAME: 'surmon',
GITHUB_USER_NAME: 'surmon-china',
INSTAGRAM_USERNAME: 'surmon666',
THREADS_USER_NAME: 'surmon666',
@@ -73,8 +72,7 @@ export const VALUABLE_LINKS = Object.freeze({
YOUTUBE_CHANNEL: `https://www.youtube.com/${IDENTITIES.YOUTUBE_CHANNEL_SHORT_ID}`,
TELEGRAM: 'https://t.me/surmon',
OPENSEA: 'https://opensea.io/Surmon',
- ZHIHU: `https://www.zhihu.com/people/${IDENTITIES.ZHIHU_USER_NAME}/answers`,
- QUORA: `https://www.quora.com/profile/Surmon/answers`,
+ ZHIHU: `https://www.zhihu.com/people/surmon/answers`,
DOUBAN: 'https://www.douban.com/people/nocower',
DOUBAN_MOVIE: `https://movie.douban.com/people/nocower/collect`,
LINKEDIN: 'https://www.linkedin.com/in/surmon',
diff --git a/src/config/bff.yargs.ts b/src/config/bff.yargs.ts
index b1c72706..91770f32 100644
--- a/src/config/bff.yargs.ts
+++ b/src/config/bff.yargs.ts
@@ -10,4 +10,3 @@ const argv = yargs(process.argv.slice(2)).argv
export const YOUTUBE_API_KEY = argv.youtube_token
export const INSTAGRAM_TOKEN = argv.instagram_token
export const THREADS_TOKEN = argv.threads_token
-export const ZHIHU_COOKIE = argv.zhihu_cookie
diff --git a/src/constants/tunnel.ts b/src/constants/tunnel.ts
index 232ea6db..aab866c3 100644
--- a/src/constants/tunnel.ts
+++ b/src/constants/tunnel.ts
@@ -12,6 +12,7 @@ export enum TunnelModule {
ThreadsProfile = 'threads_profile',
ThreadsMedias = 'threads_medias',
ThreadsMediaChildren = 'threads_media_children',
+ ThreadsMediaConversation = 'threads_media_conversation',
InstagramProfile = 'instagram_profile',
InstagramMedias = 'instagram_medias',
InstagramMediaChildren = 'instagram_media_children',
@@ -19,7 +20,6 @@ export enum TunnelModule {
BingWallpaper = 'bing_wallpaper',
NetEaseMusic = 'netease_music',
DoubanMovies = 'douban_movies',
- ZhihuAnswers = 'zhihu_answers',
GitHubSponsors = 'github_sponsors',
GitHubContributions = 'github_contributions',
StatisticGitHubJson = 'statistic_github_json',
diff --git a/src/pages/index/threads.vue b/src/pages/index/threads.vue
index 0936428e..840a31fd 100755
--- a/src/pages/index/threads.vue
+++ b/src/pages/index/threads.vue
@@ -59,7 +59,7 @@
-
+
diff --git a/src/pages/snippets/card.vue b/src/pages/snippets/card.vue
deleted file mode 100644
index d796196f..00000000
--- a/src/pages/snippets/card.vue
+++ /dev/null
@@ -1,95 +0,0 @@
-
-
-
-
-
{{ answer.question.title }}
-
-
{{ answer.excerpt }}
-
-
- {{ answer.voteup_count }} 赞同
- {{ answer.comment_count }} 评论
-
-
-
-
-
-
-
diff --git a/src/pages/snippets/desktop/index.vue b/src/pages/snippets/desktop/index.vue
index c547758a..1ab0efba 100644
--- a/src/pages/snippets/desktop/index.vue
+++ b/src/pages/snippets/desktop/index.vue
@@ -1,61 +1,45 @@
-
+
-
-
Threads
-
-
- Quora
-
+
-
+
-
+
-
+
@@ -65,19 +49,19 @@
-
-
-
+
+
+
-
+
-
@@ -89,13 +73,6 @@
-
-
-
-
-
@@ -103,7 +80,7 @@
@import '/src/styles/variables.scss';
@import '/src/styles/mixins.scss';
- .answers-page {
+ .snippets-page {
min-height: $full-page-active-content-height;
.page-banner {
@@ -140,7 +117,7 @@
}
}
- .answers-loading {
+ .data-loading {
padding: 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
@@ -161,7 +138,7 @@
}
}
- .answers-empty {
+ .data-empty {
font-weight: bold;
font-size: $font-size-h3;
}
diff --git a/src/pages/snippets/desktop/masonry.vue b/src/pages/snippets/desktop/masonry.vue
index b2ad89ad..97423c71 100644
--- a/src/pages/snippets/desktop/masonry.vue
+++ b/src/pages/snippets/desktop/masonry.vue
@@ -1,17 +1,16 @@
-
-
-
-
-
- {{ answer.question.title }}
-
-
-
-
-
- {{ answer.voteup_count }} 赞同
- {{ answer.comment_count }} 评论
-
-
-
- 回答于
-
- , 最后修改于
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/pages/snippets/mobile/index.vue b/src/pages/snippets/mobile/index.vue
index 3d25f37f..1ff3384d 100644
--- a/src/pages/snippets/mobile/index.vue
+++ b/src/pages/snippets/mobile/index.vue
@@ -4,32 +4,32 @@
import { VALUABLE_LINKS } from '/@/config/app.config'
import PageBanner from '/@/components/common/banner.vue'
import Loadmore from '/@/components/common/loadmore.vue'
- import { getZhihuAnswerDetailURL } from '/@/transforms/media'
import { scrollToNextScreen } from '/@/utils/scroller'
- import { i18nTitle, useSnippetsPageData, useSnippetsPageMeta } from '../shared'
- import AnswerCard from '../card.vue'
+ import { i18nTitle, useSnippetsPageMeta } from '../shared'
+ import { useThreadsMediasData } from '../threads/shared'
+ import ThreadsCard from '../threads/card.vue'
- const { zhihuLatestAnswers, loading, finished, allAnswers, fetchMoreAnswers } = useSnippetsPageData()
+ const { latestThreadsStore, loading, finished, allMedias, fetchMoreMedias } = useThreadsMediasData()
- const fetchMoreAnswersAndNextScreen = () => {
- fetchMoreAnswers().then(() => {
+ const fetchMoreMediasAndNextScreen = () => {
+ fetchMoreMedias().then(() => {
scrollToNextScreen()
})
}
useSnippetsPageMeta()
- useUniversalFetch(() => zhihuLatestAnswers.fetch())
+ useUniversalFetch(() => latestThreadsStore.fetch())
-
-
+
+
-
+
-
+
-
+
-
-
-
- {{ zhihuLatestAnswers?.data?.paging.totals ?? '-' }}
-
-
+
+ Threads
-
-
- -
+
+
-
+
@@ -88,10 +83,10 @@
@import '/src/styles/variables.scss';
@import '/src/styles/mixins.scss';
- .answers-page {
+ .snippets-page {
$item-gap: 1.4rem;
- .answers-loading {
+ .snippets-loading {
padding: 0;
margin-top: $item-gap;
@@ -129,7 +124,7 @@
}
}
- .answers-content {
+ .snippets-content {
margin-top: $item-gap;
.statistics {
@@ -143,24 +138,7 @@
.item {
text-align: center;
-
- .logo {
- margin-bottom: $gap-sm;
- font-size: $font-size-h1;
- &.quora {
- display: flex;
- height: $font-size-h3 * 1.4;
- line-height: $font-size-h3 * 1.4;
- font-size: $font-size-h3 * 2;
- }
- }
-
- .description {
- font-weight: bold;
- font-size: $font-size-small;
- color: $color-text-secondary;
- text-transform: uppercase;
- }
+ font-size: $font-size-h3;
}
}
diff --git a/src/pages/snippets/shared.ts b/src/pages/snippets/shared.ts
index 35d7a197..d43ced7d 100644
--- a/src/pages/snippets/shared.ts
+++ b/src/pages/snippets/shared.ts
@@ -1,13 +1,6 @@
-import { ref, shallowReactive, shallowRef, computed } from 'vue'
import { useEnhancer } from '/@/app/enhancer'
-import { useZhihuLatestAnswersStore } from '/@/stores/media'
-import type { ZhihuAnswerItem, ZhihuAnswersResponse } from '/@/server/getters/zhihu'
import { firstUpperCase } from '/@/transforms/text'
import { Language, LanguageKey } from '/@/language'
-import { TunnelModule } from '/@/constants/tunnel'
-import { delayPromise } from '/@/utils/delayer'
-import { isClient } from '/@/app/environment'
-import tunnel from '/@/services/tunnel'
import { META } from '/@/config/app.config'
export const i18nTitle = {
@@ -27,41 +20,3 @@ export const useSnippetsPageMeta = () => {
}
})
}
-
-export const useSnippetsPageData = () => {
- const zhihuLatestAnswers = useZhihuLatestAnswersStore()
- const loading = ref(false)
- const localAnswers = shallowReactive>([])
- const lastPaging = shallowRef(null)
- const nextPageOffset = computed(() => {
- const paging = lastPaging.value ?? zhihuLatestAnswers.data?.paging
- return new URL(paging!.next)?.searchParams.get('offset')
- })
- const finished = computed(() => lastPaging.value?.is_end ?? zhihuLatestAnswers.data?.paging.is_end ?? false)
- const allAnswers = computed(() => {
- const latestMedias = zhihuLatestAnswers.data?.data ?? []
- return [...latestMedias, ...localAnswers]
- })
-
- const fetchMoreAnswers = async () => {
- try {
- loading.value = true
- const request = tunnel.dispatch(TunnelModule.ZhihuAnswers, {
- offset: nextPageOffset.value
- })
- const response = await (isClient ? delayPromise(360, request) : request)
- localAnswers.push(...response.data)
- lastPaging.value = response.paging
- } finally {
- loading.value = false
- }
- }
-
- return {
- loading,
- finished,
- allAnswers,
- fetchMoreAnswers,
- zhihuLatestAnswers
- }
-}
diff --git a/src/pages/snippets/threads/card.vue b/src/pages/snippets/threads/card.vue
new file mode 100644
index 00000000..8d8a5477
--- /dev/null
+++ b/src/pages/snippets/threads/card.vue
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
diff --git a/src/pages/snippets/threads/detail.vue b/src/pages/snippets/threads/detail.vue
new file mode 100644
index 00000000..14119551
--- /dev/null
+++ b/src/pages/snippets/threads/detail.vue
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/snippets/threads/shared.ts b/src/pages/snippets/threads/shared.ts
new file mode 100644
index 00000000..3db7f399
--- /dev/null
+++ b/src/pages/snippets/threads/shared.ts
@@ -0,0 +1,44 @@
+import { ref, shallowReactive, shallowRef, computed } from 'vue'
+import { useThreadsLatestMediasStore } from '/@/stores/media'
+import type { ThreadsMedia, ThreadsMediaListResponse } from '/@/server/getters/threads'
+import { TunnelModule } from '/@/constants/tunnel'
+import { delayPromise } from '/@/utils/delayer'
+import { isClient } from '/@/app/environment'
+import tunnel from '/@/services/tunnel'
+
+export const useThreadsMediasData = () => {
+ const loading = ref(false)
+ const latestThreadsStore = useThreadsLatestMediasStore()
+ const localMedias = shallowReactive>([])
+ const lastPaging = shallowRef(null)
+ const afterToken = computed(() => {
+ return localMedias.length ? lastPaging.value?.cursors?.after : latestThreadsStore.data?.paging.cursors?.after
+ })
+ const finished = computed(() => !afterToken.value)
+ const allMedias = computed(() => {
+ const latest = latestThreadsStore.data?.data ?? []
+ return [...latest, ...localMedias]
+ })
+
+ const fetchMoreMedias = async () => {
+ try {
+ loading.value = true
+ const request = tunnel.dispatch(TunnelModule.ThreadsMedias, {
+ after: afterToken.value
+ })
+ const response = await (isClient ? delayPromise(360, request) : request)
+ localMedias.push(...response.data)
+ lastPaging.value = response.paging
+ } finally {
+ loading.value = false
+ }
+ }
+
+ return {
+ loading,
+ finished,
+ allMedias,
+ latestThreadsStore,
+ fetchMoreMedias
+ }
+}
diff --git a/src/server/getters/threads/index.ts b/src/server/getters/threads/index.ts
index 49850c0c..ef38586a 100644
--- a/src/server/getters/threads/index.ts
+++ b/src/server/getters/threads/index.ts
@@ -14,7 +14,7 @@
// 3. TODO: Refresh token
// https://developers.facebook.com/docs/threads/get-started/long-lived-tokens
-export { getThreadsMedias, getThreadsMediaChildren } from './post'
+export { getThreadsMedias, getThreadsMediaChildren, getThreadsMediaConversation } from './post'
export type { ThreadsMedia, ThreadsMediaListResponse } from './post'
export { getThreadsProfile } from './profile'
export type { ThreadsProfile } from './profile'
diff --git a/src/server/getters/threads/post.ts b/src/server/getters/threads/post.ts
index c9e6b2c3..9a57dca8 100644
--- a/src/server/getters/threads/post.ts
+++ b/src/server/getters/threads/post.ts
@@ -59,7 +59,13 @@ export const getThreadsMedias = async (options?: ThreadsMediaG
}
const response = await axios.get>(uri, { timeout: 8000, params })
- return response.data
+ return {
+ ...response.data,
+ paging: {
+ cursors: response.data.paging?.cursors
+ // MARK: remove `next` & `previous`
+ }
+ }
} catch (error) {
throw isAxiosError(error) ? (error.response?.data?.error ?? error.toJSON()) : error
}
@@ -79,3 +85,19 @@ export const getThreadsMediaChildren = (threadsMediaId: string) => {
return Promise.reject(isAxiosError(error) ? (error.response?.data?.error ?? error.toJSON()) : error)
})
}
+
+// https://developers.facebook.com/docs/threads/reply-management/#a-thread-s-conversations
+export const getThreadsMediaConversation = (threadsMediaId: string) => {
+ const uri = `https://graph.threads.net/v1.0/${threadsMediaId}/conversation`
+ const params = {
+ access_token: THREADS_TOKEN,
+ reverse: false,
+ fields: `id,text,username,permalink,timestamp,media_type,media_url,shortcode,thumbnail_url,children,is_quote_post,has_replies,root_post,replied_to,is_reply,is_reply_owned_by_me,reply_audience`
+ }
+ return axios
+ .get(uri, { timeout: 8000, params })
+ .then((response) => response.data)
+ .catch((error) => {
+ return Promise.reject(isAxiosError(error) ? (error.response?.data?.error ?? error.toJSON()) : error)
+ })
+}
diff --git a/src/server/getters/zhihu.ts b/src/server/getters/zhihu.ts
deleted file mode 100644
index 49b2c92e..00000000
--- a/src/server/getters/zhihu.ts
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- * @file BFF Zhihu getter
- * @module server.getter.zhihu
- * @author Surmon
- */
-
-import axios from '@/server/services/axios'
-import { IDENTITIES } from '@/config/app.config'
-import { ZHIHU_COOKIE } from '@/config/bff.yargs'
-
-export interface ZhihuAnswerItem {
- id: number
- url: string
- type: string
- content: string
- excerpt: string
- admin_closed_comment: boolean
- reaction_instruction: Record
- biz_ext: {
- creation_relationship: Record
- }
- updated_time: number
- voteup_count: number
- collapse_reason: string
- is_labeled: boolean
- author: {
- avatar_url_template: string
- badge_v2: {
- icon: string
- detail_badges: any[]
- night_icon: string
- merged_badges: any[]
- title: string
- }
- name: string
- headline: string
- gender: number
- user_type: string
- id: string
- is_advertiser: boolean
- avatar_url: string
- url: string
- type: string
- badge: any[]
- url_token: string
- is_org: boolean
- }
- question: {
- relationship: Record
- title: string
- url: string
- created: number
- updated_time: number
- has_publishing_draft: boolean
- question_type: string
- type: string
- id: number
- }
- comment_count: number
- content_need_truncated: boolean
- reshipment_settings: string
- attachment: {
- attachment_id: string
- type: string
- }
- answer_type: string
- annotation_action: any[]
- collapsed_by: string
- is_copyable: boolean
- is_collapsed: boolean
- is_normal: boolean
- comment_permission: string
- thumbnail: string
- extras: string
- created_time: number
- can_comment: {
- status: boolean
- reason: string
- }
-}
-
-export interface ZhihuAnswersResponse {
- data: ZhihuAnswerItem[]
- paging: {
- totals: number
- is_start: boolean
- is_end: boolean
- previous: string
- next: string
- }
-}
-
-// According to the documentation, a maximum of 20
-const ZHIHU_PAGE_LIMIT = 20
-// https://www.zhihu.com/people//answers
-const ZHIHU_INCLUDE_PARAMS = `data[*].is_normal,admin_closed_comment,reward_info,is_collapsed,annotation_action,annotation_detail,collapse_reason,collapsed_by,suggest_edit,comment_count,can_comment,content,attachment,voteup_count,reshipment_settings,comment_permission,created_time,updated_time,review_info,excerpt,paid_info,reaction_instruction,is_labeled,label_info,relationship.is_authorized,voting,is_author,is_thanked,is_nothelp;data[*].vessay_info;data[*].author.badge[?(type=best_answerer)].topics;data[*].author.vip_info;data[*].question.has_publishing_draft,relationship`
-
-// Get answers by member ID
-// https://yifei.me/note/460
-export const getZhihuAnswers = async (offset = 0) => {
- const api = `https://api.zhihu.com/members/${IDENTITIES.ZHIHU_USER_NAME}/answers`
- const response = await axios.get(api, {
- timeout: 8000,
- headers: { cookie: ZHIHU_COOKIE },
- params: {
- offset,
- limit: ZHIHU_PAGE_LIMIT,
- sort_by: 'created',
- include: ZHIHU_INCLUDE_PARAMS
- }
- })
-
- return response.data
-}
diff --git a/src/stores/_hook.ts b/src/stores/_hook.ts
index b7a85ac4..a44ed429 100755
--- a/src/stores/_hook.ts
+++ b/src/stores/_hook.ts
@@ -19,7 +19,6 @@ import { useNodepressStatisticStore, useGitHubStatisticStore, useNpmStatisticSto
import { useArticleCalendarStore, useInstagramCalendarStore, useGitHubCalendarStore } from './calendar'
import {
useDoubanMoviesStore,
- useZhihuLatestAnswersStore,
useThreadsProfileStore,
useThreadsLatestMediasStore,
useInstagramLatestMediasStore,
@@ -67,7 +66,6 @@ export const useStores = (pinia?: Pinia) => ({
// third
doubanMovies: useDoubanMoviesStore(pinia),
- zhihuLatestAnswers: useZhihuLatestAnswersStore(pinia),
threadsProfile: useThreadsProfileStore(pinia),
threadsLatestMedias: useThreadsLatestMediasStore(pinia),
instagramProfile: useInstagramProfileStore(pinia),
diff --git a/src/stores/media.ts b/src/stores/media.ts
index a1a2c0e2..2e54f9c0 100755
--- a/src/stores/media.ts
+++ b/src/stores/media.ts
@@ -9,7 +9,6 @@ import { createFetchStore } from './_fetch'
import { TunnelModule } from '/@/constants/tunnel'
import { isClient } from '/@/app/environment'
import { delayPromise } from '/@/utils/delayer'
-import type { ZhihuAnswersResponse } from '/@/server/getters/zhihu'
import type { ThreadsProfile, ThreadsMediaListResponse } from '/@/server/getters/threads'
import type { InstagramProfile, InstagramMediaListResponse } from '/@/server/getters/instagram'
import tunnel from '/@/services/tunnel'
@@ -23,17 +22,6 @@ export const useDoubanMoviesStore = defineStore('doubanMovies', () => {
})
})
-// Zhihu latest answers
-export const useZhihuLatestAnswersStore = defineStore('zhihuLatestAnswersStore', () => {
- return createFetchStore({
- data: null,
- fetcher: () => {
- const request = tunnel.dispatch(TunnelModule.ZhihuAnswers)
- return isClient ? delayPromise(480, request) : request
- }
- })
-})
-
// Threads profile
export const useThreadsProfileStore = defineStore('threadsProfile', () => {
return createFetchStore({
diff --git a/src/transforms/media.ts b/src/transforms/media.ts
index 75244399..ff52f00b 100644
--- a/src/transforms/media.ts
+++ b/src/transforms/media.ts
@@ -53,7 +53,3 @@ export const getThreadsPostDetailURL = (username: string, shortCode: string) =>
export const get163MusicSongDetailURL = (songId: string | number) => {
return `https://music.163.com/#/song?id=${songId}`
}
-
-export const getZhihuAnswerDetailURL = (questionId: number, answerId: number) => {
- return `https://www.zhihu.com/question/${questionId}/answer/${answerId}`
-}