Thread viewer for Bluesky

add (and require) a filter option in loadUserTimeline

Changed files
+17 -3
+16 -3
api.js
··· 328 328 } 329 329 330 330 /** 331 + @typedef 332 + {'posts_with_replies' | 'posts_no_replies' | 'posts_and_author_threads' | 'posts_with_media' | 'posts_with_video'} 333 + AuthorFeedFilter 334 + 335 + Filters: 336 + - posts_with_replies: posts, replies and reposts (default) 337 + - posts_no_replies: posts and reposts (no replies) 338 + - posts_and_author_threads: posts, reposts, and replies in your own threads 339 + - posts_with_media: posts and replies, but only with images (no reposts) 340 + - posts_with_video: posts and replies, but only with videos (no reposts) 341 + */ 342 + 343 + /** 331 344 * @param {string} did 332 345 * @param {number} days 333 - * @param {{ onPageLoad?: FetchAllOnPageLoad }} [options] 346 + * @param {{ onPageLoad?: FetchAllOnPageLoad, filter: AuthorFeedFilter }} options 334 347 * @returns {Promise<json[]>} 335 348 */ 336 349 337 - async loadUserTimeline(did, days, options = {}) { 350 + async loadUserTimeline(did, days, options) { 338 351 let now = new Date(); 339 352 let timeLimit = now.getTime() - days * 86400 * 1000; 340 353 341 354 return await this.fetchAll('app.bsky.feed.getAuthorFeed', { 342 355 params: { 343 356 actor: did, 344 - filter: 'posts_no_replies', 357 + filter: options.filter, 345 358 limit: 100 346 359 }, 347 360 field: 'feed',
+1
like_stats_page.js
··· 127 127 let startTime = /** @type {number} */ (this.scanStartTime); 128 128 129 129 let myPosts = await this.appView.loadUserTimeline(accountAPI.user.did, requestedDays, { 130 + filter: 'posts_no_replies', 130 131 onPageLoad: (data) => { 131 132 if (data.length == 0) { return } 132 133