-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with the API #476
Comments
Also I'm unable to retrieve comments for a given sid (whether using the ending of sid, or stoid), like for example: "stoid" : "371655", "sid" : "19/10/28/038228" should have 74 comments both: |
Second one is solved here and live patched on prod as of this evening in commit 4274259. I'll look into the first as I get time. |
The first issue is solved as main page is now searchable so &tid=1 returns the latest stories. The comment op now seems to work with the sid, but it seems to return only single comment from 2019-05-05 18:07:56 no matter what sid is passed, strange This is richardboegli from IRC. ") |
Partial PEBKAC, although the docs could be more explicit. When I first used that when working on my API bindings, I almost fell for that trap too. The docs say the |
I also want to point out that the |
Awesome stuff, thanks a ton, didn't check if discussionid works after TMB's update and it does indeed, after wasting like 5h chasing a non-issue (I guess I need to read some qml for dummies or something) I'm now able to fetch all the comments, thank you! Once I figure a nice way to present indents this will be an awesome feature (might also look at posting anon_coward comments, haven't looked too much into that yet though, anyone got experience posting from api? if it works the issue can be closed, thanks again!) |
I have a few thoughts about that: First is that sometimes something goes wrong (such as the call from the database is too slow, the connection times out, etc.) and the response is an empty 200, which means that the same API calls need to be made multiple times before you get the actual result. It is usually there on the second one, but the most I've had to do is five before getting what I've wanted. Second is that @TheMightyBuzzard broke my code with that update, as it seems I coded around the missing "s" bug. But that does make me think that maybe the argument should be named something different and the docs reflected to update the real argument name. My thinking is that discussions have their own IDs that aren't equal to either the sid or stoid, and reusing those names might be misleading. I suppose the alternative would be having the API map the sid or stoid do the mapping for you. Or just leave it the way it is as GEFGW. Before my VM I used for testing got trashed and I changed gears to being a passive API, I tried post stories and comments. Stories seemed to work well, but I remember having problems with comments. If my recollection is correct, you had to use the sid (the one with the slashes), not the discussion id or stoid, and there is a hidden pid argument to the call that allows replying to comments but I don't recall testing it (and a couple other hidden arguments that do other things in other APIs). In addition, the edited to change post comment paragraph after checking my code. |
Yep. 'discussions' is a table in the db that associates stories, journal entries, and polls with the comments made to them, so 'did' is what's going to be used once we get the API up to speed with things that aren't stories. As for 'sid' and 'stoid' being confusing and even used incorrectly interchangeably in some places, I feel your pain. It's done that way in the rehash code as well but it's too much of a pain to fix when there are more important things on the table. |
According to the ApiDocs for the story ops: You may also specify "tid" as an argument. But it seems to be required, using the example (https://soylentnews.org/api.pl?m=story&op=latest) to pull latest stories returns: "no such topic:". Trying to pull the latest stories from main page sadly also doesn't work with: "tid 1 is not searchable". Is there any way to pull latest stories from all topics, or is RSS the only way to do that right now?
The text was updated successfully, but these errors were encountered: