Forum Replies Created
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!
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.
Here’s the latest topics now that I’ve added reply count:
— Ute Hub (@Ute_Hub) June 18, 2017
Here’s the new stats page:
— Ute Hub (@Ute_Hub) June 18, 2017
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.
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.
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.
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%!
@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 excited. Check out the first image I posted in that thread!
I’ve hijacked this thread enough. Going to start one for the app.
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!
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.
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.
Pardon all my posts. You know what would be a great end point? A single topic with a replies object. Can that be done? One call which has the topic and all its replies. That might be too hard to do because of ordering of the replies as in threaded or non threaded etc.
@casiepa is there paging on your api? I like how your topics have reply counts in the object.
I’ve started coding an angular/mobile bbPress app. I’ve already got a “latest topics” feed working in the app via the API by @mapofemergence and it works great. I just ran into the first hurdle, which is that WP’s API does not allow access to user info. A custom API to get the user’s name and avatar etc would be needed.
@casiepa I will check yours out as well.
I’ve already got the “latest posts” feed working with post titles and dates. One catch is that I can’t get the author’s name because the WP API won’t allow it, presumably to prevent name harvesting. So I may have to make a custom API for that.
I’m starting development of my bbPress mobile app. I have noticed that buddyPress has an RSS feed for latest member activity, which also has bbPress posts. One could utilize that, but it is very limited and shows multiple duplicates of the same post if a user edits.
Sounds like you’ve put some good thought into it @mapofemergence and I hope to contribute on the front end side with suggestions and reports on how I’m able to get it to work, if you’d like some input/help.
I hope to start on my bbPress mobile app in the next week or two.
I’m happy to have found this discussion. Shortly after making an iOS/Android app out of one of my WP blogs I will embark on making a mobile app for my bbPress based forum at UteHub.com. So naturally I started google bbPress API.
I have yet to look at what’s returned by the bbP api plugins in this thread, but why not just use a custom post type function to add to the WP api? Is there something coming from these bbP api’s not in there?
I will be developing my bbPress app in Angular JS 1.x. I’m sure I’ll be participating more as I get into the project.
Hey @robin-w or any other BBP mods. I’m in dire need of I believe a custom walker for my custom page’s replies. I’m stumped to the point of wanting to hire someone to do it for me. Any ideas?