This commit is contained in:
hugo
2026-03-15 15:46:07 -04:00
commit f778221f3c
41 changed files with 6362 additions and 0 deletions

View File

@@ -0,0 +1,82 @@
import parseTimeline from "../parsers/timeline.js";
export async function home(opts = {}) {
const raw = await this.graphql("HomeTimeline", {
variables: {
count: opts.count || 20,
cursor: opts.cursor,
includePromotedContent: true,
latestControlAvailable: true,
requestContext: "launch",
withCommunity: true,
...opts.variables,
},
fieldToggles: {
withArticlePlainText: false,
withArticleRichContentState: false,
withAuxiliaryUserLabels: false,
},
});
return parseTimeline(raw);
}
export async function homeLatest(opts = {}) {
const raw = await this.graphql("HomeLatestTimeline", {
variables: {
count: opts.count || 20,
cursor: opts.cursor,
includePromotedContent: true,
latestControlAvailable: true,
requestContext: "launch",
withCommunity: true,
...opts.variables,
},
fieldToggles: {
withArticlePlainText: false,
withArticleRichContentState: false,
withAuxiliaryUserLabels: false,
},
});
return parseTimeline(raw);
}
export async function connect(opts = {}) {
const raw = await this.graphql("ConnectTabTimeline", {
variables: {
count: opts.count || 20,
cursor: opts.cursor,
context: "{}",
...opts.variables,
},
});
return parseTimeline(raw);
}
export async function moderated(opts = {}) {
const raw = await this.graphql("ModeratedTimeline", {
variables: {
count: opts.count || 20,
cursor: opts.cursor,
includePromotedContent: false,
...opts.variables,
},
fieldToggles: {
withArticlePlainText: false,
withArticleRichContentState: false,
withAuxiliaryUserLabels: false,
},
});
return parseTimeline(raw);
}
export async function creatorSubscriptions(opts = {}) {
const raw = await this.graphql("CreatorSubscriptionsTimeline", {
variables: {
count: opts.count || 20,
cursor: opts.cursor,
includePromotedContent: false,
...opts.variables,
},
});
return parseTimeline(raw);
}