aboutsummaryrefslogtreecommitdiff
path: root/p/api/greader.php
AgeCommit message (Collapse)Author
2022-11-14Typing function checkToken (#4561)Gravatar Luc SANCHEZ
* Typing function checkToken * Typing function and rename Co-authored-by: Luc SANCHEZ <luc.sanchez@zol.fr>
2022-10-23GReader API doc and improvements (#4763)Gravatar Alexandre Alapetite
* GReader API doc and improvements #fix https://github.com/FreshRSS/FreshRSS/issues/4762 * Minor slash * HTTPS for web.archive.org
2022-08-08Refactor entry-to-GReader API format (#4490)Gravatar Alexandre Alapetite
* Refactor entry to GReader API format Some code was copied in two locations and not completely uniform. Cleaning of related variables and functions (e.g. better types for entries and categories as objects vs. as IDs). Usecase: I need to call the same GReader-compatible serialization from an extension * Fixed some edge cases * Keep summary instead of content `summary` and `content` seems to be used interchangeably in the Google Reader API. We have been using `summary` for our client API and `content` in our export/import, so stick to that.
2022-07-04Dynamic OPML (#4407)Gravatar Alexandre Alapetite
* Dynamic OPML draft #fix https://github.com/FreshRSS/FreshRSS/issues/4191 * Export dynamic OPML http://opml.org/spec2.opml#1629043127000 * Restart with simpler approach * Minor revert * Export dynamic OPML also for single feeds * Special category type for importing dynamic OPML * Parameter for excludeMutedFeeds * Details * More draft * i18n * Fix update * Draft manual import working * Working manual refresh * Draft automatic update * Working Web refresh + fixes * Import/export dynamic OPML settings * Annoying numerous lines in SQL logs * Fix minor JavaScript error * Fix auto adding new columns * Add require * Add missing 🗲 * Missing space * Disable adding new feeds to dynamic categories * Link from import * i18n typo * Improve theme icon function * Fix pink-dark
2022-02-28Implement Web scraping "HTML + XPath" (#4220)Gravatar Alexandre Alapetite
* More PHP type hints for Fever Follow-up of https://github.com/FreshRSS/FreshRSS/pull/4201 Related to https://github.com/FreshRSS/FreshRSS/issues/4200 * Detail * Draft * Progress * More draft * Fix thumbnail PHP type hint https://github.com/FreshRSS/FreshRSS/issues/4215 * More types * A bit more * Refactor FreshRSS_Entry::fromArray * Progress * Starts to work * Categories * Fonctional * Layout update * Fix relative URLs * Cache system * Forgotten files * Remove a debug line * Automatic form validation of XPath expressions * data-leave-validation * Fix reload action * Simpler examples * Fix column type for PostgreSQL * Enforce HTTP encoding * Readme * Fix get full content * target="_blank" * gitignore * htmlspecialchars_utf8 * Implement HTML <base> And fix/revert `xml:base` support in SimplePie https://github.com/simplepie/simplepie/commit/e49c578817aa504d8d05cd7f33857aeda9d41908 * SimplePie upstream PR merged https://github.com/simplepie/simplepie/pull/723
2022-01-08Use typographic quotes (#4133)Gravatar Alexandre Alapetite
* Use typographic quotes * A few fixes * Fix * Fix not saved * Implement feedback * Detail * Revert spoken English fixes Left for a future dedicated discussion * More reverts * Final reverts * Final minor
2022-01-05[CI] PHPCS: check for opening brace on same line (#4122)Gravatar Frans de Jonge
* [CI] PHPCS: check for opening brace on same line * make fix-all * Minor comments Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-01-04PHPStan level 5 (#4110)Gravatar Alexandre Alapetite
* Fix most PHPDocs errors Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103 https://phpstan.org/writing-php-code/phpdoc-types * Avoid func_get_args Use variadic syntax instead https://php.net/manual/functions.arguments#functions.variable-arg-list And avoid dynamic functions names when possible to more easily identify calls and unused functions. Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103 * PHPStan level 3 * PHPStand level 4 * Update default to PHPStan level 4 * Towards level 5 * Fix level 4 regression * Towards level 5 * Pass PHPStan level 5 * Towards level 6 * Remove erronenous regression from changelog https://github.com/FreshRSS/FreshRSS/pull/4116
2021-12-31Add PHPStan (#4021)Gravatar Alexandre Alapetite
* Add PHPStan #fix https://github.com/FreshRSS/FreshRSS/issues/4016 https://phpstan.org/ ```sh composer run-script phpstan ``` * More fixes * Fix global variables * Add .phtml * Fix merge https://github.com/FreshRSS/FreshRSS/pull/4090 * Fix more warnings * Fix view errors and enable in CI * ReturnTypeWillChange * Dynamic view type * Fix Minz static/self bug
2021-03-24Compatibility ORIG_PATH_INFO (#3560)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/3542
2021-02-28Travis: Enforce phpcs line length + whitespace (#3488)Gravatar Alexandre Alapetite
* Update Travis line length * Also check whitespace in CSS files * Fix line length ext.php * More syntax, string templates * Fix exclude-pattern * Test JS files as well
2021-02-06API implement OPML import/export (#3424)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/3421
2021-01-22GReader API add canonical information (#3391)Gravatar Alexandre Alapetite
For fluent-reader #fix https://github.com/FreshRSS/FreshRSS/issues/3389 Better compatibility InoReader https://www.inoreader.com/developers/stream-contents
2021-01-03API more BazQux compatibility (#3320)Gravatar Alexandre Alapetite
Implement compatibility fix, to allow the streamID / inclusion criteria to be given as `&s=` parameter instead of in the URL path. https://github.com/bazqux/bazqux-api#fetching-streams This form of request is apparently sometimes used by FeedMe: ``` /api/greader.php/reader/api/0/stream/contents?output=json&n=100&xt=user%2F-%2Fstate%2Fcom.google%2Fread&ot=0&s=user%2F-%2Flabel%2FBlogs ```
2021-01-02Avoid manual initialisations of system or user configuration (#3070)Gravatar Alexandre Alapetite
* Avoid manual intialisations of system or user configuration More consistent use of Context * Simplify FreshRSS_Context::initUser * Remove a few manual get_user_configuration * A bit of debugging * Fix context user init * Fix install * Fix concurrency Concurrent requests could lead to bad race condition * Fix actualize cron Fix case when system i initialised several times
2020-11-12API fix continuation type (#3250)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/3247
2020-10-11Misc. minorGravatar Alexandre Alapetite
Whitespace...
2020-10-06Minz allow parallel sessions (#3096)Gravatar Alexandre Alapetite
* Minz allow parallel sessions #fix https://github.com/FreshRSS/FreshRSS/issues/3093 * Array optimisation * Array optimisation missing * Reduce direct access to $_SESSION except in install process * Fix session start headers warning * Use cookie only the first time the session is started: `PHP Warning: session_start(): Cannot start session when headers already sent in /var/www/FreshRSS/lib/Minz/Session.php on line 39` * New concept of volatile session for API calls Optimisation: do not use cookies or local storage at all for API calls without a Web session Fix warning: ``` PHP Warning: session_destroy(): Trying to destroy uninitialized session in Unknown on line 0 ``` * Only call Minz_Session::init once in our index It was called twice (once indirectly via FreshRSS->init()) * Whitespace * Mutex for notifications Implement mutex for notifications https://github.com/FreshRSS/FreshRSS/pull/3208#discussion_r499509809 * Typo * Install script is not ready for using Minz_Session
2020-06-20API Compatbility Reeder (#3073)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/3031#issuecomment-646973334 Reeder sends e.g. `feed/feed/247`
2020-06-19API discard common Path Info errors (#3061)Gravatar Alexandre Alapetite
Some apps auto-complete `/api/greader.php` while some do not. Discard common errors instead of failing, to be more user-friendly. E.g. if the user types the full API URL in Readrops https://github.com/FreshRSS/FreshRSS/issues/3059#issuecomment-644149548
2020-06-14Add a way to disable/enable users (#3056)Gravatar Alexis Degrugillier
If you want to block users without deleting their account, you can now disable them from the interface.
2020-06-13Fix API quickadd (#3051)Gravatar Alexandre Alapetite
* Fix API quickadd #fix https://github.com/FreshRSS/FreshRSS/issues/3049 * Response query, streamName
2020-05-08Fix bad relogging clients (#2961)Gravatar Alexandre Alapetite
* Fix bad relogging clients Some clients (like EasyRSS) are still using the old HTTP Authorization header after having logged to log in with another user. We should not attempt to process Authorization headers during a login request * Typo * A bit safer Avoid null exception
2020-05-07API relaxed detection of short/long item ID forms (#2957)Gravatar Alexandre Alapetite
#Fix https://github.com/FreshRSS/FreshRSS/issues/2956 Bug/feature introduced by https://github.com/FreshRSS/FreshRSS/pull/2947 (which was following the specification better) The original code `strpos($e_id, '/') !== null` was wrong (it can never be null, only false or integer), but the idea was to check whether the client was sending a short form (decimal) or long form of the ID (hexadecimal with prefixes including slashes). Since it has not given problem until my recent typo fix, this means that the short form is apparently not used by the clients we tested. But now that we are back to following the specification better, it looks like a client such as Reeder 4 is sending an hexadecimal form without a prefix, which breaks the detection. This patch changes the detection, which should work in all known cases AND comply with the specification https://feedhq.readthedocs.io/en/latest/api/terminology.html#items
2020-05-05Fix warning with FeedReader (#2947)Gravatar Alexandre Alapetite
FeedReader 2.10.0 sends something like `T=cd3421a73e8a09f955449d02beaf9593b0c0265cZZZZZZZZZZZZZZZZZ&r=user/-/state/com.google/read&i=-/tag%3Agoogle.com&i=-/2005%3Areader/item/0005a4b97779db22` to `/api/greader.php/reader/api/0/edit-tag` The first `i=-/tag/google.com` is wrong and cannot be converted to an entry ID. This resulted in: > PHP Warning: gmp_init(): Unable to convert variable to GMP - string is not an integer in /var/www/FreshRSS/p/api/greader.php on line 35
2020-04-30API Use string type for Usec (#2935)Gravatar Alexandre Alapetite
#Fix https://github.com/FreshRSS/FreshRSS/issues/2934
2020-04-16Expose podcast in API (#2898)Gravatar Alexandre Alapetite
* Expose podcast in API Expose RSS enclosures in our API, e.g. for clients supporting podcasts * PHP CS? * Annoying linter * Light optimisation
2020-04-01API return proper newestItemTimestampUsec (#2854)Gravatar Alexandre Alapetite
* API return proper newestItemTimestampUsec #fix https://github.com/FreshRSS/FreshRSS/issues/2853 * Minor naming * Add newestItemTimestampUsec for labels * Do not use t.name after all
2020-03-30API return OK for an empty request (#2855)Gravatar Alexandre Alapetite
Fix https://framateam.org/freshrss/pl/yozcezrnufno9eut3173d4wpry
2020-03-28GReader API consistent default category (#2840)Gravatar Alexandre Alapetite
* GReader API consistent default category #Fix https://github.com/FreshRSS/FreshRSS/issues/2839 * Also for subscription/list
2020-02-29GReader remove unsused parameter (#2816)Gravatar Alexandre Alapetite
2020-02-29Better performance with yield (#2588)Gravatar Alexandre Alapetite
* Better performance with yield Largely decrease the time to first byte, and reduced memory consumtion. Before, we used to make several copies in memory of the whole list of articles before sending them to the client. Now streamed as they are processed. * Travis
2020-01-18[API, extension] Use 'dateAdded()' to forge 'crawlTimeMsec' & ↵Gravatar Julien-Pierre Avérous
'timestampUsec' field in greader API. (#2773) - Add the ability to customize 'dateAdded()', so an extension can change it if needed.
2020-01-16Pass the entries to 'entry_before_display' extension hook (#2763)Gravatar Julien-Pierre Avérous
* Pass the entries to 'entry_before_display' extension hook. - #2762 * Fix code-style. * - Fix 'Whitespace found at end of line'. Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2019-11-02API 64-bit ID as string (#2621)Gravatar Alexandre Alapetite
Fix https://github.com/FreshRSS/FreshRSS/issues/2620
2019-10-09Fix API i18n (#2565)Gravatar Alexandre Alapetite
Fix https://github.com/FreshRSS/FreshRSS/issues/2564
2019-09-29Quick fix: API PDO visibility bug (#2545)Gravatar Alexandre Alapetite
Introduced in https://github.com/FreshRSS/FreshRSS/pull/2522
2019-09-29PDO refactoring for code simplification (#2522)Gravatar Alexandre Alapetite
* PDO refactor * Automatic prefix when using the syntax `_tableName` * Uniformity: MySQL is now PDO::ATTR_EMULATE_PREPARES = false just like SQLite and PostgreSQL, with consequences such as only one statement per query * Use PDO methods exec(), query(), prepare() + execute() in a more efficient way * Remove auto-update SQL code for versions older than FreshRSS 1.5 (3 years old) * The name of the default category is set in PHP instead of in the DB (simplies SQL and allows changing the name according to the FreshRSS language) * Rename `->bd` to `->pdo` (less of a frenshism, and more informative) * Fix some requests, which were not compatible with MySQL prepared statements * Whitespace * Fix syntax for PostgreSQL sequences + MySQL install * Minor formatting * Fix lastInsertId for PostgreSQL * Use PHP 5.6+ const Take advantage of https://github.com/FreshRSS/FreshRSS/pull/2527 https://www.php.net/manual/en/migration56.new-features.php * A bit of forgotten PHP 5.6 simplification for cURL * Forgotten $s * Mini fix custom user config https://github.com/FreshRSS/FreshRSS/pull/2490/files#r326290346 * More work on install.php but not finished * install.php working * More cleaning of PDO in install * Even more simplification Take advantage of PDO->exec() to run multiple statements * Disallow changing the name of the default category https://github.com/FreshRSS/FreshRSS/pull/2522#discussion_r326967724
2019-09-18API Reeder compatibility (#2526)Gravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/2513
2019-08-20Require PHP 5.5+ (#2495)Gravatar Alexandre Alapetite
* Require PHP 5.5+ https://github.com/FreshRSS/FreshRSS/issues/2469#issuecomment-522255093 I think it would be reasonable to require PHP 5.5+ for the core of FreshRSS after all. As Frenzie said, WordPress currently requires PHP 5.6.20+, and it is the most popular PHP application. We would loose about 20% of the PHP servers according to https://w3techs.com/technologies/details/pl-php/5/all but I expect this number to drop fast after the release of CentOS 8 (CentOS accounts for 17% of Linux servers https://w3techs.com/technologies/details/os-linux/all/all ). Distributions: * no impact on Ubuntu, Fedora, Alpine, OpenWRT, FreeBSD, OpenSuze, Mageia, as all active versions have PHP > 7 * no impact on OpenSuze, Synology, as all active versions have PHP > 5.5 * we drop Debian 8 Jessie (-2020) - we keep supporting Debian 9 Stretch (2017-06) - current is Debian 10 Buster * we drop Red Hat 7 (-2024) - we keep supporting RHEL 8 (2019-05) * we drop CentOS 7 (-2024) - we will support CentOS 8 (to be released soonish) When dropping older versions, I can better like when it is for a good reason, and there is actually one with PHP 5.5, namely generators (yield) https://php.net/language.generators.overview which I consider using. * Version note for JSON.php * hex2bin * Update .travis.yml Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
2019-06-16Fix API remove category (#2412)Gravatar Alexandre Alapetite
Fix https://github.com/FreshRSS/FreshRSS/issues/2411
2019-04-07Fix API minor code syntax warning (#2362)Gravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/2359#issuecomment-480620713
2019-01-05Automatic API test (#2207)Gravatar Alexandre Alapetite
* Automatic API test Easier for end-user, smarter, and the guess testing of greader authorization token was not reliable. * Travis + minor
2018-11-12API encoding tuning (#2120)Gravatar Alexandre Alapetite
Use only minimal XML->Unicode encoding for articles title. Follow-up of https://github.com/FreshRSS/FreshRSS/pull/2093
2018-11-11Tweaks for Vienna RSS (#2093)Gravatar Alexandre Alapetite
* Tweaks for Vienna RSS https://github.com/FreshRSS/FreshRSS/issues/2091 https://github.com/ViennaRSS/vienna-rss/issues/1197 * Fix get feed by URL * Fix get item ids returning starred elements * API add item ids by feed URL * Add API filter `it` https://feedhq.readthedocs.io/en/latest/api/reference.html#stream-items-ids * API add `nt=` filter + refactoring * No ; prefix for author https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-435562495 * Add id long form prefix and accept short id form https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-435631259 * Fix quote problem https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-435683930 * Isolate bug fix for News+ https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-435687041 * Rework encoding conventions https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-437441834 * Unicode escaping alternative Alternative approach to encode XML special characters and other problematic characters into their Unicode fullwidth version when we cannot use HTML-encoding because clients disagree wether they should HTML-decode or not. https://github.com/FreshRSS/FreshRSS/issues/2091#issuecomment-436059559
2018-10-13Minor Google Reader API commentGravatar Alexandre Alapetite
2018-09-29Custom labels (#2027)Gravatar Alexandre Alapetite
* First draft of custom tags https://github.com/FreshRSS/FreshRSS/issues/928 https://github.com/FreshRSS/FreshRSS/issues/1367 * SMALLINT to BIGINT for id_entry And uppercase SQL types * Fix layout for unreads * Start UI menu * Change menu order * Clean database helpers https://github.com/FreshRSS/FreshRSS/pull/2027#discussion_r217971535 * Travis rules do not understand PostgreSQL constants Grrr * Tag controller + UI * Add column attributes to tags * Use only favicon for now, for label * Fix styling for different themes * Constant for maximum InnoDB index length in Unicode https://github.com/FreshRSS/FreshRSS/pull/2027#discussion_r219052200 (I would have personnally prefered keeping the readability of a real value instead of a constant, in this case of many SQL fields) * Use FreshRSS_Factory::createCategoryDao * Add view of all articles containing any tag * Fix search in tags * Mark as read tags * Partial auto-update unread tags * More auto update tag unreads * Add tag deletion * Do not purge tagged articles * Minor comment * Fix SQLite and UI bug * Google Reader API support for user tags Add SQL check that tag names must be distinct from category names * whitespace * Add missing API for EasyRSS * Compatibility SQLite Problematic parentheses * Add SQL DISTINCT for cases with multiple tags * Fix for PostgreSQL PostgreSQL needs some additional type hint to avoid "could not determine data type of parameter $1" http://www.postgresql-archive.org/Could-not-determine-data-type-of-parameter-1-tp2171092p2171094.html
2018-09-16Improve authors (#2025)Gravatar Alexandre Alapetite
* Links for authors and multiple authors Favour ';' as a separator instead of ',' to better cope with multi-author scientific articles. Follow-up of https://github.com/FreshRSS/FreshRSS/pull/1997 , https://github.com/FreshRSS/FreshRSS/issues/1968, https://github.com/FreshRSS/FreshRSS/pull/2023 * Change i18n authors * Update layout * Unicode-compatible search Example for `author:Loïc` * author <em> styling * Final details * Minor spacing
2018-07-08Fix check username in API (#1957)Gravatar Alexandre Alapetite
* Fix check username in API Fix https://github.com/FreshRSS/FreshRSS/issues/1955 * Changelog 1955 https://github.com/FreshRSS/FreshRSS/issues/1955 https://github.com/FreshRSS/FreshRSS/pull/1957
2018-05-24Add Fever API and user documentation (#1836)Gravatar Kevin Papst
* added fever api and documentation * spaces to tabs * fixed code format * added links * added utf8 to header * removed XML support * removed before check, as we have to convert it afterwards * added sandboxed setting (currently disabled) added support for extensions using entry_before_display * listFeedsOrderUpdate LIMIT https://github.com/FreshRSS/FreshRSS/pull/1836/files#r175287881 * removed custom sql by using FreshRSS_FeedDAO::listFeedsOrderUpdate() * fixed mark all as read * replaced custom sql for getUnread() and getStarred() with dao functions * removed sanitization functions * Rework fever login * Fix config bug Plus documentation * Fix array syntax For compatibility with PHP 5.3 * Disable cookies and session for API * Fix currentUser * added response header and error log * adjusted phpdoc to match new authentication * Mechanism to delete old keys * replace PHP_INT_MAX with zero to disable limit * replace method_exists with check for explicit methods * removed Press support and smaller refactoring + updated docu * Rewrite bindParamArray Avoid one of the SQL injection risks * Docs and readme * Fix API link * Simplify reverse key check Using userConfig