Giter Club home page Giter Club logo

exfm's Introduction

exfm for Node.js

exfm logo belongs to exfm. Node.js logo belongs to Node.js. This project is not an official exfm project and is not affliated with.

Connect to the ex.fm API, get information and stream music!

exfm.user("silvinci").loved(cb);
exfm.song("8ugg").pipe(fs.createWriteStream("never.mp3"));
exfm.song.search("Never Gonna Give You Up");

Installation

$ npm install exfm

Usage

The exfm API makes use of chaining. Who doesn't like chaining?

Get a user's profile information.

exfm.user("dan", function(err, user) {
  if(err) throw err;
  console.log(user.name); // "Dan Kantor"
});

Get a user's loved songs.

exfm.user("dan").loved(function(err, songs) {
  if(err) throw err;
  console.log(songs); // [{ title: "Golden Light", ... }, ...]
});

Get a user's followers.

exfm.user("dan").followers(function(err, users) {
  if(err) throw err;
  console.log(users); // [{ username: "silvinci", ... }, ...]
});

Get users a user is following.

exfm.user("dan").following(function(err, users) {
  if(err) throw err;
  console.log(users); // [{ username: "majman" ... }, ...]
});

Get the IDs of the users the user is following.

exfm.user("dan").followingIds(function(err, ids) {
  if(err) throw err;
  console.log(ids); // ["majman", "chase", ...]
});

Get sites the user is following.

exfm.user("dan").followingIds(function(err, sites) {
  if(err) throw err;
  console.log(sites); // [{ name: "Black Light Dinner Party" }, ...]
});

Get a feed of songs loved by users the user is following.

exfm.user("dan").loveFeed(function(err, songs) {
  if(err) throw err;
  console.log(songs); // [{ object: { title: "Where's The Time", ... }, ... }, ...]
});

Get a feed of a user's activity, including loved songs, shared songs, and followed users.

exfm.user("dan").activity(function(err, activities) {
  if(err) throw err;
  console.log(activities); // [{ object: { title: "Where's The Time", ... }, ... }, ...]
});

Get a feed of a user's loved songs.

exfm.user("dan").activityLove(function(err, loves) {
  if(err) throw err;
  console.log(loves); // [{ object: { title: "Where's The Time", ... }, ... }, ...]
});

Get a feed of actions being perfomed on the user, such as loving of songs the user has loved (AKA relove) and following the user-

exfm.user("dan").notifications(function(err, msgs) {
  if(err) throw err;
  console.log(msgs); // [...]
});

exfm's People

Contributors

buschtoens avatar drewbharris avatar

Watchers

James Cloos avatar  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.