GithubHelp home page GithubHelp logo

node-imessage's Introduction

node-imessage

Binds iMessage to NodeJS (read-only)

ATTENTION: only available to brave coders, heavy development going on.

Discuss on HN or star the project to be updated.

Install

npm install imessage --save

To use the command line tool

npm install -g imessage

Usage

Command line

Usage: imessagejs <command>

command     
  search         Search messages with particular text
  recipients     Search messages with particular recipient
Usage: imessagejs search "text to search" [options]

Options:
   --count       Just return the count
   --recipient   ID of the recipient
   --json        Print in json format

Recipients

Usage: imessagejs recipients ["recipient name to filter"] [options]

Options:
   --count   Just return the count
   --json    Print in json format

NodeJS Library

Recipients

var iMessage = require('imessage');
var im = new iMessage();

// Get all recipients
im.getRecipients(cb)

// Get recipients with "nicola"
im.getRecipients("nicola", cb)

// Get recipient Id
im.getRecipientById(1, cb)
// Get recipient and all of his messages
im.getRecipientById(1, true, cb)

Messages

// Get all messages
im.getMessages(cb)

// Get messages with text
im.getMessages("hello you", cb);

// Get messages from recipient Id
im.getMessagesFromId(1, cb)
// Get messages from recipient with specific text
im.getMessagesFromId(1, "with text", cb)

Attachments

// Get all attachments
im.getAttachments(cb)

// Get attachements from recipient Id
im.getAttachmentsFromId(1, cb)

Use raw SQL queries

var iMessage = require('imessage');

var im = new iMessage();
im.getDb(function(err, db) {
  db.get("SELECT * FROM `messages`");
})

Ideally

var iMessage = require('imessage');

var im = new iMessage();
im
  .getAll()
  .keyword(["love", "happy"], ["sad", "hate"])
  .from(["+1231231231", "+89898989898"])
  .limit(10)
  .exec(function(err, rows) {
    console.log(rows);
  })

node-imessage's People

Contributors

nicola avatar

Watchers

 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.