Giter Site home page Giter Site logo

the-cc-dev / node-scraping-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from peermusic/node-scraping-server

0.0 1.0 0.0 25 KB

A small scraping server that performs tasks from authenticated users.

License: GNU Affero General Public License v3.0

JavaScript 100.00%

node-scraping-server's Introduction

Scraping Server

This server listens to requests for cover art and similarity information and answers with the results of a scrape engine, like the scrape engine for last.fm.

Usage

# Install the dependencies
npm install

# Run the server on localhost:8080
node index.js

Authenticate users

To access the scraping server, users have to authenticate themselves against the server with a URL that looks like this: web+peermusic://SCRAPING#host:port#user-id#secret-key

  • Add a new user: node authenticate.js add <Description of the user>
  • List all currently authenticated users: node authenticate.js list
  • Remove the access of a user: node authenticate.js remove <ID of the user>

Endpoints

The scraping server offers multiple endpoints to provide different pices of information. All endpoints expect a encrypted message as a request and return an encrypted message. The format follows the messages generated by the secure client-to-server messaging encrypt & decrypt functions.

/Cover

This endpoint returns the cover art of a given payload.

Expected request payload: JSON object with album and optional artist set

Response payload: Base64-encoded image data of the cover art

/similarTrack

This endpoint returns similar tracks to the given payload.

Expected request payload: JSON object with the keys of one of the following formats set

  • title, album (optional) and artist (optional)
  • album and artist (optional)
  • artist
  • genre

Reponse payload: JSON object in the following format

{
  "payload": {
    // initial request payload 
  },
  "result": [
    {
      // title, album and artist are always set
      // track, year and genre are optional
      "title": "Celebration Day",
      "album": "Led Zeppelin III",
      "artist": "Led Zeppelin",
      "track": 3,
      "year": 1970,
      "genre": "classic rock"
    },
    // ...
  ]
}

node-scraping-server's People

Contributors

queicherius avatar perguth avatar ryomiyaichi avatar

Watchers

 avatar

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.