pressbooks / ideas

Ideas for Pressbooks.
GNU General Public License v3.0
11 stars 4 forks source link

Fetch and store book info via API from multiple networks #265

Closed SteelWagstaff closed 4 years ago

SteelWagstaff commented 4 years ago

Use the existing Pressbooks API to fetch and store book info for multiple hosted PressbooksEDU networks in our Algolia test account.

Our API documentation: https://docs.pressbooks.org/rest-api/ The WIP spec for the directory w/ description of current data elements in V2 of Book API: https://docs.google.com/document/d/1DIHAuew1nyGErLExtHfj2rNcInvVX_scJ2DHJwzORns/edit#

Foundation checklist:

TO DO:

  1. Carlos to provide data model for feeding index (in Algolia)
  2. Create data fetcher to grab book info from networks [start with Rebus, eCampusOntario, and Pressbooks.com] and build method to add add'l networks in future
  3. Carlos and Ho Man to work on transforming JSON received via PB API to match model
  4. Store massaged data in Algolia
cagp-dev-mtl commented 4 years ago

First design draft of the 'Book fetcher' service (Proposal):

image

ho-man-chan commented 4 years ago

All research is documented here: https://docs.google.com/document/d/1XUNw6CnT4X09yT2YwNMkqxiC08e82j7C3mHo5LLMGRI/

cagp-dev-mtl commented 4 years ago

This an example of the transformed data that we will be sending to Algolia:

{
    "name": "The onboarding process",
    "inLanguage": "en",
    "author": "admin",
    "image": "https://pressbooks.test/app/plugins/pressbooks/assets/dist/images/default-book-cover.jpg",
    "license": "All Rights Reserved",
    "_links": {
        "self": [
            {
                "href": "https://pressbooks.test/theonboarding/wp-json/pressbooks/v2/metadata"
            }
        ]
    }
}