TKServer (@tkserver)

Forum Replies Created

Viewing 25 replies - 51 through 75 (of 149 total)
  • @tkserver

    Participant

    Woohoo! The first version of my bbPress app for Android is now available! It’s read only, as there’s no API for posting or logging in yet.

    https://play.google.com/store/apps/details?id=com.tmkpro.utehub

    @tkserver

    Participant

    Do you have author/avatar in replies too? Then there would be no need for users end point. Paging is huge. I’m using @mapofemergence API for paging currently.

    I’ve now joined the #bbpress slack!

    @tkserver

    Participant

    Wow am I so brain dead that I created that users end point on my own branch of your version 1.0.2 and don’t even remember? (just read previous posts and yes, apparently I did!) All I’m getting from that service is name and avatar, but that was because those were not in the latest topics or replies. If both of those had author name and avatar, I might have no need for a users endpoint unless one wanted to list posts or replies by user.

    I’m very close to releasing a read-only version of my app. A day or two likely.

    I just joined the WP slack but that’s way too busy and focused on wp core. I think a separate channel for bbPress or the api would be good.

    @tkserver

    Participant

    I’ve set up a new slack account.

    Team URL: tkserver.slack.com

    @tkserver

    Participant

    This was missing from bbp-api.php:

    	register_rest_route( 'bbp-api/v1', '/users/(?P<id>\d+)', array(
    		'methods' => 'GET',
    		'callback' => 'bbp_api_users_one',
    	) );

    and users.php was also missing.

    I’m guessing that was intentional?

    @tkserver

    Participant

    Ok @casiepa I’m trying v1.0.3 of your api. Some of the routes are different.

    The users routes do not seem to work in 1.0.3
    wp-json/bbp-api/v1/users
    wp-json/bbp-api/v1/users/1

    Still checking… Will post more findings if there are any.

    @tkserver

    Participant

    Ok now that we are on the topic of subforums, I see an issue on the API end.

    I have a forum which is a parent of about six other forums. That forum has 10 posts in it. The sub forums have 121 posts in them. The total for the parent is showing as 131 because it is counting the subforums. The problem with this is that for my paging I’m using the topic count which breaks the app. The total topics are 131, but there’s only 10 topics to show.

    Does that make sense?

    @tkserver

    Participant

    Well oops. I fell a little silly. I thought my paging was broken in the sub-forum scenario. It wasn’t. Turns out the parent form had only 10 total topics. So when I would go to page 2, there was nothing to show. LOL.

    @tkserver

    Participant

    I’ve made my own pagination which then makes sure the http calls are only for the number of records requested. I’m showing the subforums fine, and linking to them. The thing is a forum can be a parent of other forums so it can have posts in it along with the subforums. Somehow the paging is getting broken because I’m not accounting for posts vs subforums. I need to make some logic for that specific scenario.

    @tkserver

    Participant

    I’m finding doing paging on forums which have posts and also have subforums to be a pain, LOL.

    @tkserver

    Participant

    Great @casiepa I will check it out! For posts in a forum with user/avatar etc I’ve been using a modified version of the API from @mapofemergence which has been working well.

    @tkserver

    Participant

    Ok @mapofemergence it took me a bit to figure out how to fork on github (I use bitbucket normally). Here’s my fork which currently contains the addition of user name, user avatar, and forum name in the topics end point. This results in a huge speed increase over having to hit the forum api and user api while looping through the topics. So I’ve reduced the api calls from 20 down to 1 for a feed of the 10 latest topics!

    https://github.com/tkserver/BB-REST

    @tkserver

    Participant

    YES that one. Thanks @mapofemergence no worries. Travel safe. Somehow I lost that link and there is no link from your documentation to the repo. I’ve been there before! Ok I will do some forking.

    @tkserver

    Participant

    Here’s the latest topics now that I’ve added reply count:


    Here’s the new stats page:

    @tkserver

    Participant

    In addition to reply count I also added the author name and author avatar. That saved a TON of time and http calls. Huge speed increase.

    @tkserver

    Participant

    Hey @mapofemergence where’s your git hub repo? I’m forking your API a bit. I’ve added reply count to your api and I’m using it since I can’t get anything other than a null response for topics with the @casiepa api.

    https://mapofemergence.github.io/BB-REST

    @tkserver

    Participant

    For “latest posts” and other reusable listings of topics by forum or even by search (photo in first post of this thread) I need or will build a topic end point with these items:

    • Topic title
    • Topic author name and hashtag
    • Topic date
    • Reply count
    • Forum name

    Currently both API’s I’m using pull in all the topic content and a bunch of other stuff which slows down the query. I only want to pull the topic content when I’m showing it in the topic view.

    For the forum name, author name/hash, and reply count I currently have to hit the api with 2nd, 3rd, and 4th http requests to the user endpoint, forum endpoint, and reply endpoint to get the data based on the id number. So that’s like 4x the api calls. It’s not snappy when I’m showing say the last 10 topics.

    @tkserver

    Participant

    Thanks @casiepa. As of yesterday I can now hit single topics and the replies show below. I would like to do a threaded formatting like the home page of UteHub.com but that would require recursion of the replies somehow, or using my custom walker or the bbpress reply walker to generate the API output.

    I will have many ideas as I go and communicate them.

    @tkserver

    Participant

    I may end up making my own custom api specifically for each call I need. For instance, I’m calling the forum API on latest posts each time it iterates through, so that means 10 http calls. I think if I could build that into the response I could cut those queries by 90%!

    @tkserver

    Participant

    Here’s a video of my current progress.

    @tkserver

    Participant

    @mapofemergence I really like what you’ve done with your api. It is robust and the documentation is excellent. I’m not sure if my forking of Pascal’s is any good as I’ve never worked on API stuff before, but many years of PHP and WP.

    I’ve started a new thread for discussion of my bbPress mobile app here:

    I’m building a bbPress iOS and Android app

    I’m excited. Check out the first image I posted in that thread!

    @tkserver

    Participant

    I’ve hijacked this thread enough. Going to start one for the app.

    @tkserver

    Participant

    Check it out. After hacking @casiepa’s branch to get user info, I how can view a topic in my mobile bbPress app! I’m getting the user’s avatar, display_name, topic title, date posted, forum name and of course the content of the topic!
    bbpress mobile app development

    @tkserver

    Participant

    Hey @casiepa I branched your git hub repo and added a user end point so I can continue development of my mobile bbPress app. I’ve used git hub a lot, but never branched someone else’s repo so I couldn’t quite figure out how to connect them, so I just manually uploaded.

    https://pbs.twimg.com/media/DB7SnCKV0AALQha.jpg

    @tkserver

    Participant

    Should not be too hard to implement into /bbp-api/topics/id (https://github.com/ePascalC/bbp-API/wiki/API-routes)

    You get the topic data there and then an extra array with all replies.

    Along those same lines, an object including the authorId, author name, and author hashtag in the api would eliminate a need for another custom api call for user info. WP does not allow hitting user info publicly to prevent name scraping I guess.

Viewing 25 replies - 51 through 75 (of 149 total)