{"id":21297488,"url":"https://github.com/fvdm/nodejs-osx-photostream","last_synced_at":"2025-06-29T21:41:03.298Z","repository":{"id":14887294,"uuid":"17610958","full_name":"fvdm/nodejs-osx-photostream","owner":"fvdm","description":"Process new photos in real-time with iCloud PhotoStream on OSX","archived":false,"fork":false,"pushed_at":"2016-11-01T08:13:32.000Z","size":16,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2024-10-02T19:24:15.284Z","etag":null,"topics":["icloud","icloud-photostream","nodejs","osx","photostream","unlicense"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/osx-photostream","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fvdm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-10T22:34:53.000Z","updated_at":"2020-07-18T18:29:14.000Z","dependencies_parsed_at":"2022-07-12T15:13:31.997Z","dependency_job_id":null,"html_url":"https://github.com/fvdm/nodejs-osx-photostream","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fvdm%2Fnodejs-osx-photostream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fvdm%2Fnodejs-osx-photostream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fvdm%2Fnodejs-osx-photostream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fvdm%2Fnodejs-osx-photostream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fvdm","download_url":"https://codeload.github.com/fvdm/nodejs-osx-photostream/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225032996,"owners_count":17410365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["icloud","icloud-photostream","nodejs","osx","photostream","unlicense"],"created_at":"2024-11-21T14:37:42.418Z","updated_at":"2024-11-21T14:37:43.022Z","avatar_url":"https://github.com/fvdm.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"osx-photostream\n===============\n\nProcess new images in real-time with iCloud PhotoStream on OSX.\n\nThis node.js module can run in the background to listen ([kqueue](http://en.wikipedia.org/wiki/Kqueue)) for new images\nin your PhotoStream on iCloud. You can snap a photo with your iPhone and within moments have your Mac archive it to \nanother folder or do other post-processing with it.\n\n\n* [Package on npm](http://npmjs.org/package/osx-photostream)\n* [Source-code on Github](https://github.com/fvdm/nodejs-osx-photostream)\n* [Feedback](https://github.com/fvdm/nodejs-osx-photostream/issues)\n\n\nRequirements\n------------\n\n* Mac OS X (tested on 10.9 and 10.10)\n* Mac with iCloud account and PhotoStream enabled\n* Another Apple device with iCloud and PhotoStream enabled\n* [node.js](http://nodejs.org)\n\n\nInstallation\n------------\n\nThe release on npm is always the latest stable version:\n\n`npm install osx-photostream`\n\n\nThe code in the Github repository is the most recent, but can be unstable:\n\n`npm install fvdm/nodejs-osx-photostream`\n\n\nUsage\n-----\n\nThere are two ways to use this module, these can be combined:\n\n\n### Copy new images to another folder\n\nVery useful if you prefer apps like Picasa over iPhoto. For example, to archive photos before iCloud expires them after 30 days.\n\n```js\nvar ps = require('osx-photostream')('~/Pictures/iCloud')\n```\n\n\n### Do something else with new images\n\n```js\nvar ps = require('osx-photostream')()\n\nps.on( 'update', function( file ) {\n  console.log('New image added: '+ file.filename)\n})\n```\n\n\n### Copy to folder and forward with iMessage to friend\n\n```js\nvar ps = require('osx-photostream')('~/Pictures/iCloud')\nvar exec = require('child_process').exec\n \nps.on( 'copy', function( file ) {\n  // Forward image to friend with iMessage\n  exec('osascript -e \"tell application \\\"Messages\\\" to send POSIX file \\\"'+ file.copypath +'\\\" to buddy \\\"friend@email.tld\\\" of service \\\"E:my@email.tld\\\"\"')\n})\n```\n\n\nEvents\n------\n\n### update : callback( fileObject )\n\nA new file was added to your PhotoStream.\n\n```js\nps.on( 'update', function( file ) {\n  console.log( 'New image: '+ file.filename )\n})\n```\n\n\n### copy : callback ( fileObject )\n\nA new file was copied from PhotoStream to the other folder.\n\nThis event is only triggered when a destination path is set and the copy succeeded.\n\n```js\nps.on( 'copy', function( file ) {\n  // tell another app or module the image at file.copypath is ready.\n})\n```\n\n\n### watching : callback ( watchPath )\n\nThe app is watching `watchPath` for updates.\n\n```js\nps.on( 'watching', function( watchPath ) {\n  console.log( 'Watching PhotoStream' )\n})\n```\n\n\n### fail : callback ( reason, error, [fileObject] )\n\nAn error occured. You can safely ignore this event, but it may help in times of trouble.\n\nparameter  | description\n---------- | ----------------------------------------------\nreason     | See table below.\nerror      | The error as reported.\nfileObject | See below.\n\n```js\nps.on( 'fail', function( reason, error, file ) {\n  console.log( 'ERROR: '+ reason +' - '+ file.filename )\n  console.log( error )\n})\n```\n\nreason         | description\n-------------- | ------------------------------------\nexception      | Uncaught exception\nwatch error    | Something went wrong during watching\nreaddir failed | New item can not be read\nmkdir failed   | Can not create copy destination\ncopy failed    | Can not copy new file to destination\n\n\n\nfileObject\n----------\n\nproperty  | description\n--------- | -------------------------------------------\n.pathname | Path to your PhotoStream location\n.filename | Filename of the new file, i.e. IMG_5778.PNG\n.fullpath | .pathname +'/'+ .filename\n.copypath | If copied, new location with filename\n\n\nUnlicense\n---------\n\nThis is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, compile, sell, or\ndistribute this software, either in source code form or as a compiled\nbinary, for any purpose, commercial or non-commercial, and by any\nmeans.\n\nIn jurisdictions that recognize copyright laws, the author or authors\nof this software dedicate any and all copyright interest in the\nsoftware to the public domain. We make this dedication for the benefit\nof the public at large and to the detriment of our heirs and\nsuccessors. We intend this dedication to be an overt act of\nrelinquishment in perpetuity of all present and future rights to this\nsoftware under copyright law.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\nFor more information, please refer to \u003chttp://unlicense.org\u003e\n\n\nAuthor\n------\n\nFranklin van de Meent\n| [Website](http://frankl.in)\n| [Github](https://github.com/fvdm)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffvdm%2Fnodejs-osx-photostream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffvdm%2Fnodejs-osx-photostream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffvdm%2Fnodejs-osx-photostream/lists"}