6 ms·
Node-iMessage – Query iMessage from terminal and Node.js
- RoseO 12y agoI wrote a little bash script to allow for the sending of iMessages and made a little API in Node so I could send service status messages across all my devices easily. It's probably not possible to do this in pure Node but if it's of interest here is the gist: https://gist.github.com/roldershaw/7311547 https://gist.github.com/roldershaw/7311547 Now I can see iMessage chatbots being made :P
- quarterto 12y agoYou could probably do this with node-applescript[0]. EDIT: ...which appears to be a simple wrapper around osascript. [0]: https://github.com/TooTallNate/node-applescript https://github.com/TooTallNate/node-applescript
- madeofpalk 12y agoThere's now also the official Javascript for Automation[1], however I'm not sure how much that ties in with node. [1]: https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html https://developer.apple.com/library/mac/releasenotes/Interap...
- quarterto 12y agoTotally different runtime. There's no way (short of IPC) you can interface between node.js and Javascript for Automation. I suppose you could write a CommonJS Modules-compatible shim for Automation, but libraries assuming a node-like environment just wouldn't work.
- madeofpalk 12y agoYeah, that's what I assumed. I guess it might make 'developing' slightly easier thought, keeping in the same language with Node + Automation, rather than Node + AppleScript.
- aktau 12y agoCool, I have something similar cobbled together: http://www.aktau.be/2014/02/12/send-imessages-via-the-commandline-on-osx-even-to-yourself/ http://www.aktau.be/2014/02/12/send-imessages-via-the-comman... The gist version should even be able to handle input from stdin: https://gist.github.com/aktau/8958054 https://gist.github.com/aktau/8958054 Like this: ./imessage <number> < notes.txt I use it quite often :). The most difficult thing to me was getting it to work even when Messages.app wasn't started. Applescript is quite frustrating for someone who's never dealt with it before. This was on Mavericks though, not sure if that's still a problem on Yosemite. Does your version have problems with that?
- RoseO 12y agoThat's pretty cool, I never bothered handling actually starting the Messages app because I was just running it in a VM and assumed it would always work on startup. I don't use this anymore because I've ditched my iPhone.
- filipedeschamps 12y agoGenuine question: I'm seeing a lot of innovation coming from Node.js projects, some of them useful, some of them not, but even though when not, they're really creative. I'm new to programing and I'm wondering if this happened in the past for other technologies when they were released. Did they reached the same spectrum? Best regards.
- _mikz 12y agoReading SQLite database is innovation?
- filipedeschamps 12y agoWell, I can't answer your question. What I can say is I found this thread on Hacker News first page.
- matthewmacleod 12y agoI'm curious what you mean by that. This is basically a wrapper around the iMessage SQLite database – it could equally well have been implemented in Ruby, or Python, or Go. Projects like this always seem to be implemented in whatever environment the developer wants to use, which is great, but not really relevant. I don't see any particularly interesting innovation from Node.js projects when compared with any other similar community.
- jekrb 12y agoI know what you mean when something could have been implemented in X, Y, or Z language, but I too, have noticed some really interesting projects in Node.js. One of my favorites is torrent-mount. It allows me to use virtual machines directly from a torrent stream, rather than first downloading the entire vm. https://github.com/mafintosh/torrent-mount https://github.com/mafintosh/torrent-mount
- drdaeman 12y agoJavaScript happens to be hip-of-the-day language. For example, torrent-mount's idea isn't something novel. It was voiced[1] and implemented[2][3] a number of times before, and the links are what I got just by a single Google query. It's just that Node is a trending platform today (although some may say it's popularity peak had passed already), so the surrounding chatter's more active and thus you're likely to find out about those. Or, possibly, there's even some bias like when you're looking for interesting projects on resources where JS-favoring people gather. [1] http://permalink.gmane.org/gmane.comp.file-systems.fuse.devel/1666 http://permalink.gmane.org/gmane.comp.file-systems.fuse.deve... [2] https://github.com/rkfg/BTFS https://github.com/rkfg/BTFS [3] http://btslave.sourceforge.net/ http://btslave.sourceforge.net/
- nicolagreco 12y agoThanks everyone for the support. Not sure about `innovation`, but hope this abstracts iMessage nicely for developers that want to focus on the main product ;) or want to do quick and dirty little hacks, My 2c.
- BaconJuice 12y agohow does this work? How does it get the iMessage data from let say an iPhone? Or is this for Mac users only?
- tlack 12y agoLooks like iMessage for Mac stores the messages it receives in an SQLite database. This app simply reads and queries that database. See here: https://github.com/nicola/node-imessage/blob/master/index.js#L23 https://github.com/nicola/node-imessage/blob/master/index.js...
- bkurtz13 12y agoShouldn't be asking people to upvote in the README.
- nicolagreco 12y agoYou have a good point, updated.