MCPcopy
hub / github.com/afar1/fieldtheory-cli / getBookmarkById

Function getBookmarkById

src/bookmarks-db.ts:776–826  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

774}
775
776export async function getBookmarkById(id: string): Promise<BookmarkTimelineItem | null> {
777 const dbPath = twitterBookmarksIndexPath();
778 const db = await openDb(dbPath);
779 ensureMigrations(db);
780
781 try {
782 const rows = db.exec(
783 `SELECT
784 b.id,
785 b.tweet_id,
786 b.url,
787 b.text,
788 b.author_handle,
789 b.author_name,
790 b.author_profile_image_url,
791 b.posted_at,
792 b.bookmarked_at,
793 b.categories,
794 b.primary_category,
795 b.domains,
796 b.primary_domain,
797 b.github_urls,
798 b.links_json,
799 b.media_count,
800 b.link_count,
801 b.like_count,
802 b.repost_count,
803 b.reply_count,
804 b.quote_count,
805 b.bookmark_count,
806 b.view_count,
807 b.folder_ids,
808 b.folder_names,
809 b.article_title,
810 b.article_text,
811 b.article_site,
812 b.synced_at,
813 b.enriched_at,
814 b.quoted_status_id,
815 b.quoted_tweet_json
816 FROM bookmarks b
817 WHERE b.id = ?
818 LIMIT 1`,
819 [id]
820 );
821 const row = rows[0]?.values?.[0];
822 return row ? mapTimelineRow(row) : null;
823 } finally {
824 db.close();
825 }
826}
827
828export async function getStats(): Promise<{
829 totalBookmarks: number;

Callers 3

buildCliFunction · 0.85

Calls 5

openDbFunction · 0.85
ensureMigrationsFunction · 0.85
mapTimelineRowFunction · 0.85
closeMethod · 0.65

Tested by

no test coverage detected