Skip to content

ankostis/MatWiki

Repository files navigation

Image for: Repository files navigation
project MatWiki: A (semantic) MediaWiki client for Matlab.
release 1.0.0
rel_date 19 Feb 2019
home https://github.com/JRCSTU/MatWiki
license EUPL 1.2
copyright 2019 European Commission

A (semantic) MediaWiki client for Matlab.

The difficult part was to make the HTTP-requests with session cookies & redirects...

Example:

Image for: Example:
>> url = 'http://some.wiki.org/wiki/api.php';
>> mw = MWSite(url).login('Ankostis@test','qu8hqc8f07se3ra05ufcn89keecpmgtk');  % bot password 
>> mw.askargs('Category:Cars', 'Vehicle OEM', 'limit=3')
>> disp(jsonencode(results))
    AR004: [1×1 struct]
    AR005: [1×1 struct]
    AR006: [1×1 struct]
  
>> disp(mw.History)
  LogRecord with properties:

             URI: [1×1 matlab.net.URI]
         Request: [1×1 matlab.net.http.RequestMessage]
     RequestTime: [14-Feb-2019 18:32:22    14-Feb-2019 18:32:23]
        Response: [1×1 matlab.net.http.ResponseMessage]
    ResponseTime: [14-Feb-2019 18:32:23    14-Feb-2019 18:32:23]
     Disposition: Done
       Exception: [0×0 MException]

Status:

Image for: Status:

As of Feb 2019, it is in a very early stage, just a week of work:

  • REQUIRES MATLAB >= R2016b(9.1.x) for string-vectors & proper HTTP support. (e.g. for cookies: https://www.mathworks.com/help/matlab/ref/matlab.net.http.cookieinfo-class.html).
  • Features:
    • Allow bots to login.
    • run #ask semantic-queries.
    • Rudimentary error-handling.
    • Respects some of WP's UserAgent policies (Valid UserAgent, Easy to Debug).
    • Http machinery implemented as a pipeline of "handlers" (callbacks).
  • Not tested for Matlab-9.4+ (R2018a or higher), where HTTP support for application/x-www-form-urlencoded were not fully there yet.
  • Lightly tested only against MediaWiki-1.31.
  • Read Contents for an overview of the library code.
  • Read also the Changelog of the project.

Installation

Image for: Installation

Notes:

Image for: Notes:

About

Image for: About

A MATLAB client library to interface with the (Semantic) MediaWiki HTTP API

Resources

License

Stars

Watchers

Forks

Packages

Image for: Packages 0
No packages published

Languages

Image for: Languages