Open songkeys opened 1 year ago
IMO, providing a series of APIs, can make xLog more of a platform than just an app
I tried using crossbell.js
to build a simple blog for using xLog's data as CMS just for study
as a universal lib, crossbel.js
really can do this, but I had to wrap a lot of stuff for querying specific things in xLog
I think we should turn this into a discussion where is the discussions tab or discuss this topic in Discord?
In addition, I really want to expand Crossbell's notes API for more convenient content classification and recommendation, but it seems difficult to achieve.
I think we should turn this into a discussion
where is the discussions tabor discuss this topic in Discord?
@enpitsuLin We don't have the discussions tab so far. We could have one but I think there would be too many places for "discussions" (issues tab, discussions tab, discord channels).
In addition, I really want to expand Crossbell's notes API for more convenient content classification and recommendation, but it seems difficult to achieve.
@DIYgod Could you elaborate more on this?
IMO, providing a series of APIs, can make xLog more of a platform than just an app
I tried using
crossbell.js
to build a simple blog for using xLog's data as CMS ~just for study~as a universal lib,
crossbel.js
really can do this, but I had to wrap a lot of stuff for querying specific things in xLogI think we should turn this into a discussion ~where is the discussions tab~ or discuss this topic in Discord?
I am also like you, now publishing to xlog in mx-space/admin is also implemented through crossbell.js and unidata.
Any progress on this?
Hi @Songkeys, this sounds like an interesting thing for me.
In sakuin, I must find xLog-related attributes in metadata.content.attributes
. There is no type safety, I need to make sure there is this attribute or not.
I'd love to work on this in my free time, maybe start with a sdk for xLog.
@hyoban I appreciate that you could pick this up. You could start with an API proposal. Let me know if we could help with anything here or in the Discord server.
@Songkeys Because it should be a long task, maybe it will be more convenient to discuss on discord. I will get in touch with you there.
Background
I'm aware of the
crossbell.js
indexer API that can query anything on the blockchain. But what if we had specific APIs for xLog?Benefits
Drawbacks
Examples
Reads:
/api/sites/:handle/posts
: fetch all xLog posts from a user/api/sites/:handle/posts/:slug
: get one post/api/sites/:handle/posts/:slug/comments
: get comments on a post/api/sites/:handle/posts/:slug/stats
: get "reads", "likes", "mints", etc. stats for one postWrites:
I'm not sure if this would make things more complex - If the user has authorized siwe + operator, they can use the token to write with API (just another wrapper of the
/op
APIs on the current indexer)POST /api/sites/:handle/posts
: post a new articlePUT /api/sites/:handle/posts/:slug/likes
: like a new article