+ },
+
+ async toot(title) {
+
+ const body = new FormData();
+ body.set(
+ 'status',
+ `New post: ${title}\n\nAvailable on:\n\nāļø the gemini archive ${internals.archivePublicUrl}\n\n or, the ephemeral blog š: ${internals.blogPublicUrl}`
+ );
+ return fetch(`https://${internals.mastodonDomain}/api/v1/statuses`, {
+ method: 'POST',
+ headers: {
+ Authorization: `Bearer ${internals.tootToken}`,
+ },
+ body
+ });
+ },
+
+ async getBookmarks() {
+
+ const url = join(internals.apiUrl, 'bookmarks') + '?q=%23linkblog';
+ const response = await fetch(url, {
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: `Token ${internals.apiToken}`
+ }
+ });
+ const data = await response.json();
+
+ return data.results;
+ },
+
+ async updateBookmark(bookmark) {
+
+ const url = join(internals.apiUrl, 'bookmarks', `${bookmark.id}`)
+ const response = await fetch(url, {
+ method: 'PATCH',
+ body: JSON.stringify(
+ {
+ tag_names: bookmark.tag_names.map((tag) => tag === 'linkblog' ? 'linkblog-posted' : tag)
+ }
+ ),
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: `Token ${internals.apiToken}`
+ }
+ });