Skip to content
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

API / programmable access #16

Closed
nodiscc opened this issue Aug 3, 2014 · 9 comments
Closed

API / programmable access #16

nodiscc opened this issue Aug 3, 2014 · 9 comments

Comments

@nodiscc
Copy link
Member

nodiscc commented Aug 3, 2014

We already have RSS and ATOM available as a read-only API.
This can be used for many things (I have a python script that fetches my RSS feed, locally saves pages tagged readlater, downloads media for music and video tags, images matching some URLs (*.jpg, imgur.com)...). The only missing features for my point of view are:

  • Authenticated access (access to private links, HTML export functionality)
  • Write access (HTML import, add/edit/remove links, tags...)
@pmaziere
Copy link

Why not use a existing API such as delicious as a base ?
That is the choice made by semanticScuttle in order to keep compatibility with all existing delicious based tools, and it seems a good idea.

@nodiscc
Copy link
Member Author

nodiscc commented Nov 8, 2014

@pmaziere I think the need for a real API is not there.

This report was about interfacing Shaarli with external tools (archivers, browsers, etc.). This functionality should depend on these tools themselves (eg. wallabag should be able to auto-save articles from an RSS feed, which is the standard way of accessing a Shaarli's data. https://github.com/nodiscc/shaarchiver uses HTML exports, but should support RSS feeds soon).

Most of the linked bugs are now fixed, or there is a proposed solution.

Write access would only require implementing another URL parameter (&noconfirm=yes) to allow external tools/scripts to post items to a Shaarli.

This issue will hopefully be closed soon (see remaining bugs)

@nodiscc
Copy link
Member Author

nodiscc commented Dec 1, 2014

I will now close this as it was a "tracking" issue and most related bugs are now closed, or a solution has been proposed. Feel free to reopen issues for specific bugs or requests, and check the links in the original issue text.

@mro
Copy link

mro commented Aug 25, 2015

I consider the http get parameters, html form content and page flow the API.

  • How could we - as a part of the travis build - ensure a certain behaviour?
  • Would bash+curl test scripts make sense?
  • How could phpunit help here?

@mro mro mentioned this issue Aug 26, 2015
@virtualtam
Copy link
Member

#316 also related

PHPUnit itself is not designed to run functional tests, as you need to:

  • run an HTTP server
  • run an HTTP client to send, receive and verify requests

This is rather the domain of SeleniumHQ, which can be used both for verifying:

  • HTTP headers
  • generated pages

Some info:

Any feedback/PR on using Selenium for PHP browser automation is more than welcome, this would be great to have for v0.8.0 to help with templating and W3C compliance checks

@mro
Copy link

mro commented Sep 1, 2015

Looks a bit hairy but may be worth while: http://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP

@mro
Copy link

mro commented Sep 3, 2015

test multiple shaarli versions at once: https://github.com/mro/phptestdemo

@mro
Copy link

mro commented Sep 5, 2015

The tests mentioned above show a strange pattern for 'wrong password' login failures with certain, mostly recent, releases: https://travis-ci.org/mro/Shaarli-API-test/builds/78946245

I suspect php caching which I'm clueless about in travis environments.

Any ideas?

@virtualtam
Copy link
Member

#342 opened to focus on functional testing :)

ArthurHoaro pushed a commit to ArthurHoaro/Shaarli that referenced this issue May 8, 2016
ArthurHoaro pushed a commit to ArthurHoaro/Shaarli that referenced this issue May 8, 2016
ajabep added a commit to ajabep/Shaarli that referenced this issue Apr 2, 2021
When we try to access the atom feed and have no bookmarks, it raised the following exception :

```
Call to a member function reorder() on array /webroot/application/bookmark/BookmarkFileService.php:143
#0 /webroot/application/feed/FeedBuilder.php(106): Shaarli\Bookmark\BookmarkFileService->search(Array, 'public', false, false, true)
shaarli#1 /webroot/application/front/controller/visitor/FeedController.php(47): Shaarli\Feed\FeedBuilder->buildData('atom', Array)
shaarli#2 /webroot/application/front/controller/visitor/FeedController.php(20): Shaarli\Front\Controller\Visitor\FeedController->processRequest('atom', Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#3 [internal function]: Shaarli\Front\Controller\Visitor\FeedController->atom(Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
shaarli#4 /webroot/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
shaarli#5 /webroot/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
shaarli#6 /webroot/application/front/ShaarliMiddleware.php(55): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#7 [internal function]: Shaarli\Front\ShaarliMiddleware->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#8 /webroot/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Array, Array)
shaarli#9 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#10 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#11 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#12 /webroot/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#13 /webroot/vendor/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#14 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#15 /webroot/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#16 /webroot/vendor/slim/slim/Slim/App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#17 /webroot/index.php(177): Slim\App->run(true)
shaarli#18 {main}
```
ArthurHoaro pushed a commit to ArthurHoaro/Shaarli that referenced this issue May 8, 2021
When we try to access the atom feed and have no bookmarks, it raised the following exception :

```
Call to a member function reorder() on array /webroot/application/bookmark/BookmarkFileService.php:143
#0 /webroot/application/feed/FeedBuilder.php(106): Shaarli\Bookmark\BookmarkFileService->search(Array, 'public', false, false, true)
#1 /webroot/application/front/controller/visitor/FeedController.php(47): Shaarli\Feed\FeedBuilder->buildData('atom', Array)
#2 /webroot/application/front/controller/visitor/FeedController.php(20): Shaarli\Front\Controller\Visitor\FeedController->processRequest('atom', Object(Slim\Http\Request), Object(Slim\Http\Response))
#3 [internal function]: Shaarli\Front\Controller\Visitor\FeedController->atom(Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#4 /webroot/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#5 /webroot/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
shaarli#6 /webroot/application/front/ShaarliMiddleware.php(55): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#7 [internal function]: Shaarli\Front\ShaarliMiddleware->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#8 /webroot/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Array, Array)
shaarli#9 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#10 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
shaarli#11 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#12 /webroot/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#13 /webroot/vendor/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#14 /webroot/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#15 /webroot/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#16 /webroot/vendor/slim/slim/Slim/App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))
shaarli#17 /webroot/index.php(177): Slim\App->run(true)
shaarli#18 {main}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants