aboutsummaryrefslogtreecommitdiff
path: root/p/api
AgeCommit message (Collapse)Author
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-06-19Update all test dependencies (#4419)Gravatar Alexandre Alapetite
* Update all test dependencies * Remove old false-positive * Minor update lock files * Increase PHPStan memory for Fedora https://github.com/FreshRSS/FreshRSS/pull/4400#issuecomment-1159514197 * Require PHP8+ for tests Due to small changes of signature in `ob_implicit_flush` and `simplexml_load_string`, cf. https://github.com/FreshRSS/FreshRSS/pull/4123 * Missing lint in CSS files
2022-06-02New search engine (#4378)Gravatar Alexandre Alapetite
* New possibility to invoke user queries from a search expression From the search field: `S:"My query"`. Can be combined with other filters such as `S:"My query" date:P3d` as long as the user queries do not contain `OR`. A use-case is to have an RSS filter with a stable address or an external API call with the ability to update the user query. * Draft of parenthesis logic * More draft * Working parenthesis (a OR b) (c OR d) * Working (A) OR (B) * Support nested parentheses + unit tests + documentation * search:MySearch and S:3
2022-03-22WebSub: Use hash instead of base64 to handle long URLs (#4282)Gravatar Alexandre Alapetite
* WebSub: Use hash instead of base64 to handle long URLs * Use 410 Gone (Part of the WebSub specification https://www.w3.org/TR/websub/ )
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-02-07More PHP type hints for Fever (#4202)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
2022-02-06Fix Fever 32 bit ID issue + more PHP type hints (#4201)Gravatar Alexandre Alapetite
* Fix Fever 32 bit ID issue + more PHP type hints #fix https://github.com/FreshRSS/FreshRSS/issues/4200 Follow up and fix regression from https://github.com/FreshRSS/FreshRSS/pull/4110 * More PHP type hints with PHPStan * Fix pull problem * Avoid more nulls
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-08Fix various typos and spelling errors in documentation, comments and code. ↵Gravatar Thomas Renes
(#4134)
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-12-12fever: fix warning of unset array key (#4056)Gravatar Felix Bühler
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-17Stream instead of memory copy of SimplePie entries (#2972)Gravatar Alexandre Alapetite
* Stream instead of memory copy of SimplePie entries https://github.com/FreshRSS/FreshRSS/issues/2952 * Undo lines delete * Typo * Remove unaccessible code https://github.com/FreshRSS/FreshRSS/pull/2972/files#r425624163 * Back-compatibility for Feed->entries https://github.com/FreshRSS/FreshRSS/pull/2972/files#r425631913
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-05-03Fever integer type for numbers (#2946)Gravatar Alexandre Alapetite
* Fever integer type for feed ID #Fix https://github.com/FreshRSS/FreshRSS/issues/2940#issuecomment-623022435 * Fix feed_id * Ensure string for entry ID To be compatible with 32-bit platforms. Before, the type was inconsistent depending on architecture + database * Integer for entry count functions
2020-05-02Fever integer type for last_refreshed_on_time (#2944)Gravatar Alexandre Alapetite
#Fix https://github.com/FreshRSS/FreshRSS/issues/2940 https://feedafever.com/api
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-12-29fix: Fix undefined function _t on WebSub (#2743)Gravatar Marien Fressinaud
I published an article via WebSub, but I never received it. So I checked my logs to find why and I found the following stacktrace: ``` 29/Dec/2019:15:58:32 +0000 "POST /api/pshb.php" 500 NOTICE: PHP message: PHP Fatal error: Uncaught Error: Call to undefined function _t() in /path/app/Models/Category.php:83 Stack trace: /path/app/Models/CategoryDAO.php(417): FreshRSS_Category->_id(1) /path/app/Models/CategoryDAO.php(192): FreshRSS_CategoryDAO::daoToCategory(Array) /path/app/Models/Feed.php(466): FreshRSS_CategoryDAO->searchById('1') /path/app/Controllers/feedController.php(416): FreshRSS_Feed->cleanOldEntries() /path/p/api/pshb.php(141): FreshRSS_feed_Controller::actualizeFeed(0, 'https://flus.io...', false, Object(SimplePie)) {main} thrown in /path/app/Models/Category.php on line 83 ``` The `_t` function should be loaded with the Minz_Translate class, but the latter isn't initialized on WebSub endpoint. In my opinion, we should not have to care about this kind of detail of implementation and it reveals a deeper architectural misconception, but for now the fix should be enough. It’s quite difficult to reproduce locally though.
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>