npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

flickr-upload-via-email

v0.1.2

Published

Email monitoring and auto-uploading image attachments to Flickr

Downloads

5

Readme

flickr-upload-via-email

Library that monitors an IMAP email account and auto-uploads image attachments to Flickr

Installation

npm install flickr-upload-via-email --save

Usage

/**
 * This function creates an imap email listener that monitors
 * incoming emails to a certain user, and uploads attached
 * images to Flickr.
 *
 * You can set a filter so that only emails coming from certain
 * addresses are handled, and/or emails with certain subjects.
 *
 * Note that to use this, you must have access to authorized
 * oauth token and oauth token secret for the Flickr user you
 * wish the images to be uploaded to. You also need to create
 * a Flickr app on Flickr's developer pages, so that you get
 * access to 'Flickr app consumer key' and 'Flickr app consumer
 * key secret' credentials.
 * See https://www.flickr.com/services/developer/
 *
 * If you want help with getting access to authorized oauth
 * token and oauth token secret credentials, see
 * https://www.npmjs.org/package/flickr-oauth-and-upload
 * 
 * For parameters and example usage, see below.
 * 
 * Optional parameters:
 * 'subjects': an optional comma-separated list of words
 * to look for in the subject line. If this is set, and
 * subject does not match, the image will not be used
 * for upload.
 * 'strict': if set to 1, the email subject will have
 * to strictly match any of the 'subjects'.
 *  (Non-strict matching means case insensitive and
 * string length insensitive.)
 * 'from': a comma-separated list of email addresses to
 * look for. If this is set, and if 'from' addresses do
 * not match, the email will not be used for upload.
 * 'cleanup': if set to 1, the attached images will be
 * stored only temporarily on the file system, and as
 * soon as an image has been uploaded it will be locally
 * deleted.
 * 'callback': an optional callback with two arguments,
 * err and photoId. In the successful case, the callback
 * will be called with photoId set to the unique Flickr
 * photo id that has been assigned to the uploaded image.
 *
 *
 * Example of usage:
 * 
 * This will monitor [email protected]
 * and check if subject of incoming emails strictly
 * matches either of words 'upload' or 'flickr'. If
 * it does, and if the incoming email is sent
 * from address [email protected],
 * any attached images will be automatically
 * uploaded to Flickr.
 */ 
 var listener = require('flickr-upload-via-email');
 
 var arg = {
   emailUsername: '[email protected]',
   emailPassword: '...',
   emailHost: 'imap.gmail.com',
   emailPort: 993,
   flickrConsumerKey: '31...',
   flickrConsumerKeySecret: 'aa...',
   flickrOauthToken: '11...',
   flickrOauthTokenSecret: '22...',
   subjects: 'upload,flickr',
   strict: 1,
   from: '[email protected]',
   cleanup: 1,
   callback: function (err, photoId) {
     if (!err) {
       console.log('uploaded photo. photoId=' + photoId);
     }
   }
 };
 
 listener.createListener(arg);

Notes / TODO

Tests

npm test
TODO write test cases

License

BSD-2-Clause

Release History

  • 0.1.1 Documentation
  • 0.1.0 Initial release