Giter Site home page Giter Site logo

memparse's Introduction

Memparse

Build Status Coverage Status

Memparse is a Memrise course parser. It can be used from the command line or from a function in a Node.js project.

CLI usage

First, globally install memparse: npm i --save -g memparse

memparse <courseId> [--file <output-file>]

  courseId - required course id, i.e. http://www.memrise.com/course/<courseId>
  --f, -file  - optional file name to write the output to,
             if none is provided it will be printed to the console

Output format to file is JSON, to console - prettified JSON.

Example command: memparse 1098046 -f output.json - will write this course to output.json:

{
  "course": "Spanish (Spain) 4",
  "levels": [
    {
      "name": "Relax with the Crew",
      "words": [
        {
          "word": "emocionante",
          "meaning": "exciting"
        },
      ...
    },
    ...
  ]
}

Node.js usage

Install memparse to node_modules: npm i --save memparse

Example

const memparse = require('memparse')(1098046)
memparse.parse()
  .then(json => console.log(json.levels[0].words[0]))

Output: { "word": "emocionante", "meaning": "exciting" }

API

  • require('memparse') - returns memparse initializer, which requires courseId parameter.

  • memparse.parse() - returns ES6 Promise, which eventually returns JSON array

  • memparse.xrayParse() returns Xray object

  • memparse.BASE_URL - url constant which is being used to access memrise course, currently: http://www.memrise.com/course

memparse's People

Contributors

vincaslt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

alanrostin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.