friendship ended with social-app. php is my new best friend

fix missing feed descriptions + wrong link to feed creator profile

Changed files
+53 -22
css
_partials
js
lib
pages
templates
+10 -1
README.md
···
maybe! i'm not sure if i can or will go for 100% feature parity but i'm going to try my darndest
## tdl
* [X] Move profile rendering to bskyRenderer lib file (and also fix the rendering)
···
* [X] Apply facets to text
* [X] Templating engine??
* [ ] Make login page actually work
-
* [X] Figure out how to do threading
* [ ] User authentication (:C)
* [ ] Fetch next set of items when user hits bottom of container
* [ ] ?? how to get following count ??
···
maybe! i'm not sure if i can or will go for 100% feature parity but i'm going to try my darndest
+
the idea is
+
+
* no javascript components just straight vanilla javascript (except the compilation tools)
+
* only the javascript required to load new posts and set settings
+
* use as much native html functionality as possible (popovers, details/summary)
+
* work around the central bsky servers whenever possible
+
* keep it runnable on a potato
+
* maintain admin flexibility with respect to data sources and themeing
+
## tdl
* [X] Move profile rendering to bskyRenderer lib file (and also fix the rendering)
···
* [X] Apply facets to text
* [X] Templating engine??
* [ ] Make login page actually work
+
* [X] Figure out how to do threading (never mind threading sucks)
* [ ] User authentication (:C)
* [ ] Fetch next set of items when user hits bottom of container
* [ ] ?? how to get following count ??
+4
css/_partials/_profile.scss
···
}
}
.actions {
position: absolute;
top: -15px;
···
}
}
+
.description {
+
margin: 1em 0;
+
}
+
.actions {
position: absolute;
top: -15px;
+9 -10
js/userposts.mjs
···
if (document.querySelector('main').classList.contains("profile") && document.querySelectorAll('.postsList > .post').length > 0) {
-
console.log("it's a profile");
-
const observer = new IntersectionObserver(() => {
const container = document.querySelector('.postsList');
const lastPost = document.querySelector('.postsList > .post:last-child');
-
console.log(lastPost);
const cursor = lastPost.getAttribute('data-cursor');
const user = lastPost.getAttribute('data-did');
-
console.log(cursor);
-
console.log(user);
const params = new URLSearchParams();
params.append("user", user);
params.append("cursor", cursor);
fetch(`/api/userPosts?${params}`)
.then((data) => {
data.text().then((content) => {
container.innerHTML += content;
});
}, (err) => {
console.error(err);
});
-
}, {
-
root: page,
-
threshold: 0.9
-
});
-
observer.observe(document.querySelector('main'));
}
···
if (document.querySelector('main').classList.contains("profile") && document.querySelectorAll('.postsList > .post').length > 0) {
+
const observerCheck = (entry, observer) => {
const container = document.querySelector('.postsList');
const lastPost = document.querySelector('.postsList > .post:last-child');
const cursor = lastPost.getAttribute('data-cursor');
const user = lastPost.getAttribute('data-did');
const params = new URLSearchParams();
params.append("user", user);
params.append("cursor", cursor);
+
observer.unobserve(lastPost);
fetch(`/api/userPosts?${params}`)
.then((data) => {
data.text().then((content) => {
container.innerHTML += content;
+
const newobserver = new IntersectionObserver(observerCheck);
+
newobserver.observe(document.querySelector('.postsList > .post:last-child'));
});
}, (err) => {
console.error(err);
+
const newobserver = new IntersectionObserver(observerCheck);
+
newobserver.observe(document.querySelector('.postsList > .post:last-child'));
});
+
}
+
const observer = new IntersectionObserver(observerCheck);
+
observer.observe(document.querySelector('.postsList > .post:last-child'));
}
+1 -1
lib/bskyToucher.php
···
'embeds' => property_exists($post->value, 'embed') ? $this->sanitizeEmbeds($post->value->embed, $authorInfo) : [],
'cursor' => $cursor
];
-
\updatePostCache($rkey, $did, $ret->content, $ret->embedType, json_encode($ret->embeds), '');
return $ret;
}
···
'embeds' => property_exists($post->value, 'embed') ? $this->sanitizeEmbeds($post->value->embed, $authorInfo) : [],
'cursor' => $cursor
];
+
\updatePostCache($rkey, $did, $ret->content, $ret->embedType, json_encode($ret->embeds), $post->value->createdAt);
return $ret;
}
+8 -7
pages/about.md
···
the ethos of smallbird social is to be as low-tech as possible. as few dependencies as possible, as little javascript as possible. we are mostly on the internet of 2003 here. this also means there are no apps. nothing is going in an app store although i intend for this to be as mobile-friendly as possible but i do not want to deal with 1) building an app and 2) dealing with the app store review process, which would mean this whole process would be subject to censorship.
-
**I'm in Mississippi and I can't see your website?**
-
Sorry, I am one woman and can't deal with potentially incurring a fuckton in fines if someone decides i look legit enough.
-
### server information
-
**Public API Subscription:** api.public.bsky.app, until another appview exists
-
**Constellation Subscription:** constellation.snek.cc
-
**Slingshot Subscription:** slingshot.microcosm.blue
-
**PLC Directory:** plc.directory
···
the ethos of smallbird social is to be as low-tech as possible. as few dependencies as possible, as little javascript as possible. we are mostly on the internet of 2003 here. this also means there are no apps. nothing is going in an app store although i intend for this to be as mobile-friendly as possible but i do not want to deal with 1) building an app and 2) dealing with the app store review process, which would mean this whole process would be subject to censorship.
+
### server information
+
+
* **Public API Subscription:** api.public.bsky.app, until another appview exists
+
* **Constellation Subscription:** constellation.smallbird.social
+
* **Slingshot Subscription:** slingshot.microcosm.blue
+
* **PLC Directory:** plc.directory
+
### answers
+
no one has asked me questions but just in case
+1 -1
templates/_partials/feedHeader.latte
···
<div class="description">{$description}</div>
<div class="info">
<ul>
-
<li><b>creator:</b> <a href="/p/@{$creatorHandle}">{$creatorDisplay}</a> (<a href="/p/@{$creatorHandle}">{$creatorHandle}</a>)</li>
<li><a href="https://pdsls.dev/{$creatorDid}" target="_blank" rel="external">{$creatorDid}</a></li>
<li><b>pds:</b> <a href="{$creatorPds}" target="_blank" rel="external">{$creatorPds}</a></li>
</ul>
···
<div class="description">{$description}</div>
<div class="info">
<ul>
+
<li><b>creator:</b> <a href="/p/@{$creatorHandle}">{$creatorDisplay}</a> (<a href="/u/{$creatorHandle}">{$creatorHandle}</a>)</li>
<li><a href="https://pdsls.dev/{$creatorDid}" target="_blank" rel="external">{$creatorDid}</a></li>
<li><b>pds:</b> <a href="{$creatorPds}" target="_blank" rel="external">{$creatorPds}</a></li>
</ul>
+1 -1
templates/feed.latte
···
{block title} | {$feedName}{/block}
{block content}
-
{include '_partials/feedHeader.latte', displayName: $feedName, description: $description, avatar: $avatar, creatorDisplay: $feedAuthorName, creatorHandle: $feedAuthorHandle, creatorPds: $feedAuthorPds, creatorDid: $feedAuthorDid, feedAtUri: $feedAtUri}
{include '_partials/feedPosts.latte', posts: $posts}
{/block}
···
{block title} | {$feedName}{/block}
{block content}
+
{include '_partials/feedHeader.latte', displayName: $feedName, description: $feedDescription, avatar: $feedAvatar, creatorDisplay: $feedAuthorName, creatorHandle: $feedAuthorHandle, creatorPds: $feedAuthorPds, creatorDid: $feedAuthorDid, feedAtUri: $feedAtUri}
{include '_partials/feedPosts.latte', posts: $posts}
{/block}
+19 -1
templates/settings.latte
···
{block content}
<h2>Settings</h2>
-
At some point settings will go here!
{/block}
···
{block content}
<h2>Settings</h2>
+
<p>(none of these work yet sorry)</p>
+
<details><summary>Account</summary>
+
At some point settings will go here!
+
</details>
+
<details><summary>Privacy + Security</summary>
+
At some point settings will go here!
+
</details>
+
<details><summary>Moderation</summary>
+
At some point settings will go here!
+
</details>
+
<details><summary>Notifs</summary>
+
At some point settings will go here!
+
</details>
+
<details><summary>Content + Media</summary>
+
At some point settings will go here!
+
</details>
+
<details><summary>Interface</summary>
+
At some point settings will go here!
+
</details>
{/block}