Lemmy App Development

711 readers
1 users here now

A place for Lemmy builders to chat about building apps, clients, tools and bots for the Lemmy platform.

On-Topic:

Off-Topic:

founded 1 year ago
MODERATORS
51
52
 
 

Hi all,

I've put together some code on on Val Town that easily allows auto-publishing videos on Youtube channels to a Lemmy community.

It's simple enough that hopefully anyone should be able to set it up, and Val Town has a free tier which should be enough for anyone to publish a few feeds for free. There's a "README" on top showing how it's used.

Anyway, let me know what you think! If you end up using it, I'd love to get some thoughts on how easy it was to set up etc.

53
 
 

The Limit property is just a number, but it is different for different API endpoints. I'd like to have a list of the different values so i can easily stay within the max for each endpoint. Are the values documented somewhere? From the official js-client docs site, not even a given endpoint documents its maximum.

54
 
 

Sometimes an API request returns {"comments":[]} and {"posts":[]} respectively, for a post and community, where posts and comments show up on the web frontend. Is that happening to any of you too? How do I handle it?

Edit: did some more testing, it's most definitely a federation issue. If I query the instance that the post was made on for the comments, everything works fine. If I query my home instance, the result comes back empty.

Edit 2: As always, just after publicly showcasing my lack of programming abilities, I discover it's been me the entire time. Make sure to await promises and to fetch posts from the correct instance, guys.

55
 
 

i have requests to fetch comment and post data, but i'm struggling to work out how to build a tree from the responses? do i fetch comments with arg parent_id to get a comment's children, and do so recursively for those comments returned that themselves have comments?

56
0
submitted 1 year ago* (last edited 1 year ago) by mykl@lemmy.world to c/lemmydev@lemm.ee
 
 

This happens for me on a small number of posts, and is generally repeatable, even when the website shows comments.

For instance, running on lemmy.world, GetPost(id: 290602) tells me the post exists and has 7 comments, as does https://lemmy.world/post/290602

But GetComments(postId: 290602) returns an empty list.

If I run against the original post on 'programming.dev', GetComments(postId: 99912) does show me the comments, but I don't think I'm supposed to be second guessing the federating logic :-)

Has anyone seen anything similar or can confirm they see this same behaviour for this post?