Thread viewer for Bluesky

add (and require) a filter option in loadUserTimeline

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