Proxigram supports Facebook

You can now pull in photos from your Facebook account. Right now, it grabs everything, but I have controls in the works to let you choose privacy settings or hide individual photos.

There’s pseudo realtime support, too. Proxigram should update basically as soon as you upload the photo.

As always, everything is on Github.

Proxigram now supports Flickr

Quick update on Proxigram: it now supports Flickr, Yahoo’s popular photo sharing service. If you’re a Pro account holder, it will even get realtime updates from Flickr, just like Instagram provides.

The “point” of the app has changed, too. The goal is to build a single API endpoint for all of your photos. While the photos will still be hosted on their respective services, you can now get one read-only API to see a normalized view of them all.

The project is still open source, so if you’re looking for a sample node app that connects multiple third party services via oAuth (using passport.js), you can get the source on Github.

Facebook support is coming next. If you want support for your favorite photo services, please let me know what you want or, if you have the ability, submit pull requests with patches.

I’ve also written a few bits of supporting code for this. I abstracted out the basic PubSubHubbub verification calls into a standalone library: node-push-helper.

I also have stubbed out a new node Flickr client. I made a new one because I wanted to use oAuth instead of the deprecated Flickr authentication methods. After trying to retrofit one of the other libraries, I decided to just start over. I may merge this back into one of them, but for now, expect new functionality in the coming weeks. Here it is: node-flickr.

Would love code reviews and criticism from node experts. I know the code can be better.

Proxigram – a sprint using Node.js, Express.js, & the Instagram API

I’m happy to share a little experiment I played with this week. I needed to take a look at Node.js & it’s family of technology for a project but found it hard to find good explanations of best practices, etc. There are a half-dozen competing boilerplate/template samples that have very little in the way of explanation or comments. So, I decided the best way to get familiar with the nitty gritty of building a Node/Express app was to write one.

I decided to solve a simple problem I had. I wanted to get my recent photos from Instagram onto my blog. I wanted it to be a simple JS call or plugin, and I wanted it to be smart about storing keys for read-only access to my Instagram account. It seemed like a simple proxy for the Instagram API would suffice. The OAuth credentials are stored on the proxy and a new, non-Instagram specific key gets embedded in the JS.

And thus, Proxigram was born.

Sure, it’s a little contrived, but now that I’ve built it, I’ve got ideas for some improvements and, even better, I now have a functional, real app to share with everyone so I can get feedback about all the things I did poorly.

The source code is all on Github, both for Proxigram itself as well as the jQuery Proxigram library to access it.

The app is interesting to look at on a few levels. The package.json listing the bits and pieces I used is below. The app talks to the Instagram API, obviously uses MongoDB to cache results local to the app. It keeps that cache fresh by using Instagram’s real-time API to get updates for users. It uses passport.js for authentication (though it seems like more of the cool kids are using everyauth these days). It uses less.js for the stylesheets.

So, if you need a working example for all of those things, here you go.

Please leave feedback about things that make you itch about the code. I know a bunch of you are serious Node.js mavens, so I’m really curious what you folks think and what conventions you’re following in your projects. My biggest question at this point is how to deal with making shared components available to code in different files. For example, I made some of the authentication filters global because I split my routes up into multiple “controller-ish” files. None of the boilerplate/template apps did it better, IMHO. If you have thoughts on that one, let me know.

PS. The images on the right are getting served through Proxigram. 🙂

Here’s the dependency list from my package.json:

{
    "name": "proxigram"
  , "version": "0.1.0"
  , "private": true
  , "dependencies": {
      "express": "2.5.8"
    , "less-middleware": ">= 0.0.1"
    , "jade": ">= 0.0.1"
    , "moment": ">= 0.0.1"
    , "passport": ">= 0.1.8"
    , "passport-instagram": ">= 0.1.1"
    , "passport-http-bearer": ">= 0.1.2"
    , "mongoose": ">= 2.5.0"
    , "connect": ">= 0.0.1 < 2"
    , "connect-redis": ">= 1.0.0"
    , "connect-heroku-redis": ">= 0.1.2"
    , "airbrake" : ">=0.2.0"
    , "instagram-node-lib": ">=0.0.7"
    , "express-messages-bootstrap": "git://github.com/sujal/express-messages-bootstrap.git#bootstrap2.0"
  }
  , "engines": {
      "node": "0.6.x"
    , "npm":  "1.1.x"
  }
}