API discussion

Development-related discussion, including bundled plugins
johnnychicago
Bear Rating Trainee
Bear Rating Trainee
Posts: 36
Joined: 25 Jul 2011, 23:26

Re: API discussion

Postby johnnychicago » 02 Aug 2011, 17:50

Nils,

On the boss's request, am poking you here. I am a somewhat recent but very happy user of the Android app.

One thing I'm missing is support for labels, and one thing I've noticed not working correctly is the 'fresh articles' filter, which seems to show a random selection of articles, not necessarily unread.

Is labels something you are thinking about implementing (or maybe have done so, but I haven't been able to find)?

nils.braden
Bear Rating Trainee
Bear Rating Trainee
Posts: 43
Joined: 25 Oct 2010, 12:12
Contact:

Re: API discussion

Postby nils.braden » 02 Aug 2011, 18:25

Hi,

no I haven't done anything on the labels-issue yet since I don't use them at all.
Just had a quick look at the feature and am trying to find out what would be necessary to use it properly:
1. Display labels in main-view and show articles of this label when opened
2. Allow to add/remove articles from labels (1 article can have several labels, right?)
3. Add/remove labels (perhaps only add since you can screw up a lot by accident when you delete a label?)

About the fresh articles: Hm, I am not sure what the problem is and I haven't noticed anything since I hardly use this feature either. Are the articles which are shown at least all fresh or are also older articles displayed? Meaning, are there to much or not enough or wrong articles displayed?

General stuff for those who are concerned:
I think before I start implementing this I'll give the UI and the background-updating some more thought since at the moment this bothers me most. When opening the reader several things are updated (counters, categories, feeds, headlines with content, in this order) and while these background tasks run you don't see any progress in the UI. I'd like to see the UI refreshed after getCounters returns and not only when everything is done.

Another thing would be to improve the API by adding a timestamp to getHeadlines so I could fetch everything that is new with one call. At the moment I fetch everything that is unread or 50 articles, depending on which is the higher number, and overwrite everything locally. This is much more work to do for the phone but since I can't know which articles are new and which are old articles that have been marked unread I have to do it that way.
@fox: The DB includes a last_changed attribute, doesn't it? To get all articles since 126345124 would be quite like fetching "fresh articles", wouldn't it? If you introduce me with a proper way to do it I'll try to write the API-part :)

At the moment a typical start of the reader looks like this:

Code: Select all

2786ms   {"op":"login","user":"n"}
1000ms   {"op":"getCounters","output_mode":"fc"}
 121ms   {"op":"getCategories"}
 370ms   {"op":"getFeeds","cat_id":"-4"}
2180ms   {"limit":"12","op":"getHeadlines","show_content":"1","is_cat":"1","include_attachments":"1","feed_id":"3","view_mode":"unread"}
2180ms   {"limit":"54","op":"getHeadlines","show_content":"1","is_cat":"1","include_attachments":"1","feed_id":"0","view_mode":"unread"}


Problem with getHeadlines and view_mode:unread/all_articles is that you don't get articles that are new but already marked as read. You would have to fetch the number of unread articles plus some guessed number of read articles to make sure you got everything. For most users a plus of 50 would be fine but introduces more JSON-parsing on a mobile device which is unecessary.

Greetings,
nils

johnnychicago
Bear Rating Trainee
Bear Rating Trainee
Posts: 36
Joined: 25 Jul 2011, 23:26

Re: API discussion

Postby johnnychicago » 02 Aug 2011, 18:48

nils.braden wrote:no I haven't done anything on the labels-issue yet since I don't use them at all.
Just had a quick look at the feature and am trying to find out what would be necessary to use it properly:
1. Display labels in main-view and show articles of this label when opened
2. Allow to add/remove articles from labels (1 article can have several labels, right?)
3. Add/remove labels (perhaps only add since you can screw up a lot by accident when you delete a label?)


Frankly, I'd think showing the label in main view and allowing access to labelled articles would be sufficient - to me. I wouldn't see myself creating or changing labels on the device, since it mostly involves setting up filters, which I'd prefer to do in the browser.

About the fresh articles: Hm, I am not sure what the problem is and I haven't noticed anything since I hardly use this feature either. Are the articles which are shown at least all fresh or are also older articles displayed? Meaning, are there to much or not enough or wrong articles displayed?


In main view, article count for unread on the 'fresh' articles is correct. However accessing the articles, it shows some 50-odd articles, only the last few of which are actually unread.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: API discussion

Postby fox » 02 Aug 2011, 21:09

@fox: The DB includes a last_changed attribute, doesn't it? To get all articles since 126345124 would be quite like fetching "fresh articles", wouldn't it? If you introduce me with a proper way to do it I'll try to write the API-part :)


Yep, I suppose this could be done. :) Edit: main problem there is queryFeedHeadlines() can't do it since tt-rss never needed it, but this could be expanded easily enough. I'll try to add the necessary stuff tomorrow.

nils.braden
Bear Rating Trainee
Bear Rating Trainee
Posts: 43
Joined: 25 Oct 2010, 12:12
Contact:

Re: API discussion

Postby nils.braden » 03 Aug 2011, 02:58

fox wrote:I'll try to add the necessary stuff tomorrow.


Please don't hurry, I haven't time to do anything the next week so for me it doesn't matter ;)
I am workin on my masters thesis and will hand it in next week, then I got a presentation about it and then I already booked my holday-stay in croatia/italy... :)

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: API discussion

Postby fox » 03 Aug 2011, 09:37

Good luck with your thesis then. :)

nils.braden
Bear Rating Trainee
Bear Rating Trainee
Posts: 43
Joined: 25 Oct 2010, 12:12
Contact:

Re: API discussion

Postby nils.braden » 07 Aug 2011, 15:12

Thanks :)

Btw. another thing that came up these day as a feature request: Publish with a note. Currently doesn't seem to be possible with the API, or am i missing something?

Greetings,
nils

edit:
Labels: done
Progress-Notification: done
(see market or project-page)

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: API discussion

Postby fox » 29 Nov 2011, 09:55

From the better-late-than-never department: this is now possible using updateArticle. :)

Also, getCategories now properly returns Uncategorized and virtual categories.

nils.braden
Bear Rating Trainee
Bear Rating Trainee
Posts: 43
Joined: 25 Oct 2010, 12:12
Contact:

Re: API discussion

Postby nils.braden » 29 Nov 2011, 22:12

Ah thats great news. Got some time to spare this evening and just started implementing stuff (publish with a note already works, check for api-level is implemented). The SINCE-ID-thing will probably take one or two days since I need to reconsider some old techniques I used to make sure all articles are fetched but it WILL BE DONE! :D

Greetings,
nils

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: API discussion

Postby fox » 29 Nov 2011, 23:37

I guess I'll have to add publish with note too. FEATURE RACE. :P

nils.braden
Bear Rating Trainee
Bear Rating Trainee
Posts: 43
Joined: 25 Oct 2010, 12:12
Contact:

Re: API discussion

Postby nils.braden » 01 Dec 2011, 21:04

Ah, I just noticed you added your app to the market. I actually haven't really looked at the code yet since I realized it was too far away from the concept how activities are used in my app so I couldn't copy from the Fragments-stuff. Tried to implement it myself but so far i only managed to make it look like it was before while using fragments in the background. Next step is to try to make the communication work with two visible activities but I spent several days reading about it and haven't got a clue what to do. ;)

Greetings,
nils

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: API discussion

Postby fox » 02 Dec 2011, 10:22

The entire SDK is a mess. Fragments being a bolted-on hack nobody thought through really doesn't help things at all.

nils.braden
Bear Rating Trainee
Bear Rating Trainee
Posts: 43
Joined: 25 Oct 2010, 12:12
Contact:

Re: API discussion

Postby nils.braden » 19 Jan 2013, 14:02

Hi Andrew,

I recently implemented the functionality to handle labels in my app, so users can assign articles to labels. Unfortunately I mixed up the request (implement tags) with my idea what was to be implemented (implement labels), so the issue is still there. Thing is, the API doesn't provide tags. Are you planning to implement this in the API? Is this even advisable to do, editing tags from within the client?

There are some other things I would like to discuss but haven't got the time right now. It's the old issue about the maximum number of articles provided by getHeadlines but it can wait. ;)

Greetings,
Nils

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: API discussion

Postby fox » 19 Jan 2013, 19:33

I think tags are included in getHeadlines so you can see them, but not edit. I'm not sure it's worth the trouble, generally the UI side of tt-rss is oriented on label manipulation, those have nice colors and stuffs. I was sort of deemphasizing tags ever since proper labels got implemented.

It's the old issue about the maximum number of articles provided by getHeadlines but it can wait. ;)


This isn't changing, long running http requests without feedback are a bad idea in my opinion.

It's not like it's hard to daisy-chain this stuff, seriously.

stormwatch
Bear Rating Trainee
Bear Rating Trainee
Posts: 13
Joined: 21 Mar 2013, 04:38

Re: API discussion

Postby stormwatch » 21 Mar 2013, 08:26

fox wrote:I think tags are included in getHeadlines so you can see them, but not edit. I'm not sure it's worth the trouble, generally the UI side of tt-rss is oriented on label manipulation, those have nice colors and stuffs. I was sort of deemphasizing tags ever since proper labels got implemented.


¿Which is the difference between tags and labels then? (besides the obvious like colours)

I am yet another new Google Reader refugee, so please excuse my ignorance, IIRC google had only folders at first, very much like rr-tss categories. Later they implemented multiple folders and called them tags. But I understand that labels in tt-rss apply to articles rather than feeds, hence my former question. How they differ from tags? Are tags deprecated? (Currently I am using tags with the nsfw plug-in)


Return to “Development”

Who is online

Users browsing this forum: No registered users and 2 guests