based on a change in the past the api has weird inconsistencies right now.
feed ids used to be only feed/1 but got converted to google-api-standard strings: #3049
The API-endpoints below still use the old format:
item/idsgreader.php#L683stream/contents greader.php#L627it still only accepts something like this feed/1, but it should be instead accepting feed/http://feeds.feedburner.com/alistapart/main
currently i am also working with the items/contents and i am unable to get any other response then 400: Bad Request!, but this can be a problem on my side.
@Stunkymonkey Could you please post cURL examples, so that I can better understand the problem(s)?
The quickadd API still returns something like "streamId":"feed/238"
curl -s -H "Authorization:GoogleLogin auth=alice/..." -X POST 'https://freshrss.example.net/api/greader.php/reader/api/0/subscription/quickadd?quickadd=http://feeds.arstechnica.com/arstechnica/science'
{"numResults":1,"query":"http://feeds.arstechnica.com/arstechnica/science","streamId":"feed/238","streamName":"Science – Ars Technica"}
But yes, I can try to add the ability to address feeds by their (unstable) URL if you like.
For me its fine to stick with feed/<id>, but I am not sure if this could have some incompatibilities with other tools.
I just wanted to be sure, that the api-wrapper I write for the news-flash are done correctly.
Ok @Stunkymonkey
So far, I have not spotted any compatibility issue with the apps we tried:
https://github.com/FreshRSS/FreshRSS/blob/master/README.md#apis--native-apps
So is it good after all?
then its fine for me.
Maybe you could help me in providing a request for items/contents. Currently all my attempts ended in a "400: Bad Request!"
Example:
curl -s -H "Authorization:GoogleLogin auth=alice/..." -d 'i=1594735486442505&i=1594553684923713' \
'https://freshrss.example.net/api/greader.php/reader/api/0/stream/items/contents'
{
"id": "user/-/state/com.google/reading-list",
"updated": 1594735739,
"items": [{
"id": "tag:google.com,2005:reader/item/0005aa674a2e1c09",
"crawlTimeMsec": "1594735486442",
"timestampUsec": "1594735486442505",
"published": 1594734660,
"title": "AMD Ryzen 9 3900XT Memory Scaling Performance Under 100 Different Tests",
"summary": {
"content": "For those thinking of picking up one of the new AMD Ryzen 3000XT series processors and weighing whether it's worthwhile on your budget picking up DDR4-3600 memory or other higher frequency DDR4 modules, here are some fresh benchmark results with the Ryzen 9 3900XT looking at 100 different tests on Linux and showing how the performance changes from DDR4-2133 through DDR4-3800..."
},
"alternate": [{
"href": "http://www.phoronix.com/scan.php?page=news_item&px=Ryzen-9-3900XT-DDR4-Memory"
}
],
"categories": ["user/-/state/com.google/reading-list", "user/-/label/Informatique Int."],
"origin": {
"streamId": "feed/145",
"title": "Phoronix"
}
}, {
"id": "tag:google.com,2005:reader/item/0005aa3cf5f71541",
"crawlTimeMsec": "1594553684923",
"timestampUsec": "1594553684923713",
"published": 1594551840,
"title": "Fedora Approves Of Making Nano The Default Terminal Text Editor, Other Features Accepted",
"summary": {
"content": "At this week's Fedora Engineering and Steering Committee (FESCo) meeting, more features were approved for the Fedora 33 release due out this fall..."
},
"alternate": [{
"href": "http://www.phoronix.com/scan.php?page=news_item&px=Fedora-33-Nano-Is-The-Default"
}
],
"categories": ["user/-/state/com.google/reading-list", "user/-/label/Informatique Int."],
"origin": {
"streamId": "feed/145",
"title": "Phoronix"
}
}
]
}
However, I do not think this is an efficient call for typical synchronisation. Please check first my suggestion:
https://github.com/FreshRSS/FreshRSS/issues/2566#issuecomment-541317776
yes thanks. First I want to implement all methods, and then use the ones which fit perfectly.
thanks for your help
Ok; you probably only need a little subset of the API for your purpose, though :-)
I think it helps to take existing apps, and check their calls.
One can produce full logs in FreshRSS by uncommenting those two lines:
https://github.com/FreshRSS/FreshRSS/blob/master/p/api/greader.php#L929-L930
Here is for instance a trace for News+, which I use as a reference because it has an efficient synchronisation approach:
[Mon, 08 Oct 2018 09:02:46 +0200] [debug] --- Array
(
[date] => 2018-10-08T09:02:46+02:00
[headers] => Array
(
[Connection] => Keep-Alive
[Authorization] => GoogleLogin auth=test/ABCDEF0123456789
)
[_SERVER] => Array
(
[PATH_INFO] => /reader/api/0/tag/list
[REQUEST_URI] => /api/greader.php/reader/api/0/tag/list?client=newsplus&output=json&ck=1538982165918
[QUERY_STRING] => client=newsplus&output=json&ck=1538982165918
[REQUEST_METHOD] => GET
[SCRIPT_FILENAME] => /usr/share/FreshRSS/api/greader.php
[HTTP_AUTHORIZATION] => GoogleLogin auth=test/ABCDEF0123456789
[PHP_SELF] => /api/greader.php/reader/api/0/tag/list
)
[_GET] => Array
(
[client] => newsplus
[output] => json
[ck] => 1538982165918
)
)
[Mon, 08 Oct 2018 09:02:46 +0200] [debug] --- Array
(
[date] => 2018-10-08T09:02:46+02:00
[headers] => Array
(
[Connection] => Keep-Alive
[Authorization] => GoogleLogin auth=test/ABCDEF0123456789
)
[_SERVER] => Array
(
[PATH_INFO] => /reader/api/0/subscription/list
[REQUEST_URI] => /api/greader.php/reader/api/0/subscription/list?client=newsplus&output=json&ck=1538982165918
[QUERY_STRING] => client=newsplus&output=json&ck=1538982165918
[REQUEST_METHOD] => GET
[SCRIPT_FILENAME] => /usr/share/FreshRSS/api/greader.php
[HTTP_AUTHORIZATION] => GoogleLogin auth=test/ABCDEF0123456789
[PHP_SELF] => /api/greader.php/reader/api/0/subscription/list
)
[_GET] => Array
(
[client] => newsplus
[output] => json
[ck] => 1538982165918
)
)
[Mon, 08 Oct 2018 09:02:49 +0200] [debug] --- Array
(
[date] => 2018-10-08T09:02:49+02:00
[headers] => Array
(
[Connection] => Keep-Alive
[Authorization] => GoogleLogin auth=test/ABCDEF0123456789
)
[_SERVER] => Array
(
[PATH_INFO] => /reader/api/0/stream/contents/user/-/state/com.google/reading-list
[REQUEST_URI] => /api/greader.php/reader/api/0/stream/contents/user%2F-%2Fstate%2Fcom.google%2Freading-list?client=newsplus&ck=1538982165918&xt=user/-/state/com.google/read&ot=1538978853&n=1000&r=n
[QUERY_STRING] => client=newsplus&ck=1538982165918&xt=user/-/state/com.google/read&ot=1538978853&n=1000&r=n
[REQUEST_METHOD] => GET
[SCRIPT_FILENAME] => /usr/share/FreshRSS/api/greader.php
[HTTP_AUTHORIZATION] => GoogleLogin auth=test/ABCDEF0123456789
[PHP_SELF] => /api/greader.php/reader/api/0/stream/contents/user/-/state/com.google/reading-list
)
[_GET] => Array
(
[client] => newsplus
[ck] => 1538982165918
[xt] => user/-/state/com.google/read
[ot] => 1538978853
[n] => 1000
[r] => n
)
)
[Mon, 08 Oct 2018 09:02:50 +0200] [debug] --- Array
(
[date] => 2018-10-08T09:02:50+02:00
[headers] => Array
(
[Connection] => Keep-Alive
[Authorization] => GoogleLogin auth=test/ABCDEF0123456789
)
[_SERVER] => Array
(
[PATH_INFO] => /reader/api/0/stream/items/ids
[REQUEST_URI] => /api/greader.php/reader/api/0/stream/items/ids?output=json&s=user%2F-%2Fstate%2Fcom.google%2Freading-list&xt=user/-/state/com.google/read&n=10000&r=n
[QUERY_STRING] => output=json&s=user%2F-%2Fstate%2Fcom.google%2Freading-list&xt=user/-/state/com.google/read&n=10000&r=n
[REQUEST_METHOD] => GET
[SCRIPT_FILENAME] => /usr/share/FreshRSS/api/greader.php
[HTTP_AUTHORIZATION] => GoogleLogin auth=test/ABCDEF0123456789
[PHP_SELF] => /api/greader.php/reader/api/0/stream/items/ids
)
[_GET] => Array
(
[output] => json
[s] => user/-/state/com.google/reading-list
[xt] => user/-/state/com.google/read
[n] => 10000
[r] => n
)
)
[Mon, 08 Oct 2018 09:02:50 +0200] [debug] --- Array
(
[date] => 2018-10-08T09:02:50+02:00
[headers] => Array
(
[Connection] => Keep-Alive
[Authorization] => GoogleLogin auth=test/ABCDEF0123456789
)
[_SERVER] => Array
(
[PATH_INFO] => /reader/api/0/stream/contents/user/-/state/com.google/starred
[REQUEST_URI] => /api/greader.php/reader/api/0/stream/contents/user%2F-%2Fstate%2Fcom.google%2Fstarred?client=newsplus&ck=1538982165918&xt=user/-/state/com.google/read&ot=1538978853&n=1000&r=n
[QUERY_STRING] => client=newsplus&ck=1538982165918&xt=user/-/state/com.google/read&ot=1538978853&n=1000&r=n
[REQUEST_METHOD] => GET
[SCRIPT_FILENAME] => /usr/share/FreshRSS/api/greader.php
[HTTP_AUTHORIZATION] => GoogleLogin auth=test/ABCDEF0123456789
[PHP_SELF] => /api/greader.php/reader/api/0/stream/contents/user/-/state/com.google/starred
)
[_GET] => Array
(
[client] => newsplus
[ck] => 1538982165918
[xt] => user/-/state/com.google/read
[ot] => 1538978853
[n] => 1000
[r] => n
)
)
[Mon, 08 Oct 2018 09:02:51 +0200] [debug] --- Array
(
[date] => 2018-10-08T09:02:51+02:00
[headers] => Array
(
[Connection] => Keep-Alive
[Authorization] => GoogleLogin auth=test/ABCDEF0123456789
)
[_SERVER] => Array
(
[PATH_INFO] => /reader/api/0/stream/contents/user/-/state/com.google/starred
[REQUEST_URI] => /api/greader.php/reader/api/0/stream/contents/user%2F-%2Fstate%2Fcom.google%2Fstarred?client=newsplus&ck=1538982165918&n=1000&r=n
[QUERY_STRING] => client=newsplus&ck=1538982165918&n=1000&r=n
[REQUEST_METHOD] => GET
[SCRIPT_FILENAME] => /usr/share/FreshRSS/api/greader.php
[HTTP_AUTHORIZATION] => GoogleLogin auth=test/ABCDEF0123456789
[PHP_SELF] => /api/greader.php/reader/api/0/stream/contents/user/-/state/com.google/starred
)
[_GET] => Array
(
[client] => newsplus
[ck] => 1538982165918
[n] => 1000
[r] => n
)
)
[Mon, 08 Oct 2018 09:02:52 +0200] [debug] --- Array
(
[date] => 2018-10-08T09:02:52+02:00
[headers] => Array
(
[Connection] => Keep-Alive
[Authorization] => GoogleLogin auth=test/ABCDEF0123456789
)
[_SERVER] => Array
(
[PATH_INFO] => /reader/api/0/stream/items/ids
[REQUEST_URI] => /api/greader.php/reader/api/0/stream/items/ids?output=json&s=user%2F-%2Fstate%2Fcom.google%2Fstarred&n=10000&r=n
[QUERY_STRING] => output=json&s=user%2F-%2Fstate%2Fcom.google%2Fstarred&n=10000&r=n
[REQUEST_METHOD] => GET
[SCRIPT_FILENAME] => /usr/share/FreshRSS/api/greader.php
[HTTP_AUTHORIZATION] => GoogleLogin auth=test/ABCDEF0123456789
[PHP_SELF] => /api/greader.php/reader/api/0/stream/items/ids
)
[_GET] => Array
(
[output] => json
[s] => user/-/state/com.google/starred
[n] => 10000
[r] => n
)
)
hi @Alkarex,
i started working on the freshrss-newsflash implementation.
Due to my exams, I am not sure how much I can work on it.
I think what you want to tell me with your messages about the syncing process:
use the filter as restrictive as possible (specially restrictive timestamps) and only sync the wanted/updated items.
did i understand this right?
@Stunkymonkey My main advise was to save time by focussing on the bits of the API you really need, and also take inspiration from the precise calls from other apps.
When it comes to syncing the state of articles changed by the client, using IDs is fine. But in order to massively retrieve new articles (or to get changed articles status from the server), using a method returning all articles matching a filter is more efficient.