Host a Personal Data API on Heroku

Josh Beckman makes some pretty cool stuff. One of my favorite creations of his is Stark Lines. He’s also got a pretty neat API on his site that allows others to query it to get information about him. It’s at http://www.bckmn.com/api. Some of Josh’s JSON is generated on the fly with data from other API’s, and is built with Node.js.

You can make a similar API for your website really easily with a little PHP and Heroku. I put the whole thing up on GitHub so you can contribute (programming language examples especially) or totally make it your own.

I wanted to make it really easy for anyone to setup. You could get it setup with nothing but a text editor. Hosting your Personal API on heroku is quite nice as it provides great speeds and relatively good uptimes. Plus, if you’re a git fan, git push heroku master feels really good, lol.

Do you use Heroku for anything?

View Results

Loading ... Loading ...

Of course, there’s always some concerns.

1. A Standard

Ideally, every “personal site” with an /api URL or api.* subdomain should contain the same info, or MOST of the info, probably just the basics like name, age, langues, and location (maybe). If their was a standard it’d be very easy to grab info about LOTS of people, which may or may not be such a good idea. And that leads nicely to my next point

2. Privacy

There’s obviously some things you don’t want public, like your address and probably phone number. If you do implement a personal API like this, I suggest you modify the array to suit your needs. It’s extremely easy to edit, all it requires is a text editor, like Sublime Text. If there was a “Standard” personal API like mentioned above, it’s be very easy for attackers to just hit every website at /api or /api.php and pull down all the data.

Enough with concerns, gimme more

The benefits are pretty endless, especially depending on what kind of info your API provides. For example, people can fetch my name, employer, age, blogs, sites I run, generic family information and various other things. Authentication would be a good idea, too. You could provide relatively harmless info, like name and age, to the general public, but could require an API key to get even more JSON. That way, you could give friends and family access to more information.

Run It!

This is built to run on Heroku. Here’s a pretty basic way of deploying to Heroku.

  1. Fork tlongren/personal-api on GitHub and make a local clone.
  2. Install the Heroku Toolbelt and login to Heroku with the command “heroku login“. Enter your username and password to login with the Heroku Toolbelt.
  3. Create a new app on Heroku either through the web interface, or with the command “heroku create“. If you do it with the command line the app name will be shown to you, see here.
  4. Open a terminal and go into the folder that you cloned your fork into and run the command “heroku git:remote -a heroku-app-name“. That will add a remote named “heroku” to your local clone.
  5. Now, while still in your local clone folder, run “git push heroku master” to push your app to Heroku. If your app is named “heroku-app-name”, you can access your app at http://heroku-app-name.herokuapp.com.

And that’s all there is to getting setup with Heroku, a total of 5 steps, with just 4 simple commands.

See the GitHub repository for more info.

See any issues or have any concerns? Leave a comment below or at Hacker News.

Advertisements

Reinvigorate Snoop

reinvigorateSnoopReinvigorate has released a tool called Snoop that will stream live web stats to your desktop. For those of you who have never heard of Reinvigorate, it’s a website analytics solution similar to Google Analytics. Snoop includes some pre-defined events, such as new visitors and notification of returning visitors. You can also setup custom events. Custom events can be created on any website that supports JavaScript. Snoop is available for Windows and Mac currently, I’m hoping they have plans to build a GTK2 interface for Linux.

Snoop interacts with your Reinvigorate account, displaying current visitors and the pages they’re viewing in real time. It even displays comments if a reader posts a comment. Here’s some features available in Snoop:

Real-time Notification
A dedicated asynchronous (non-polling) connection is maintained with Reinvigorate. You’ll know the instant someone makes a comment on your blog, posts in your forum, purchases an item, gets referred from another site, etc..

Audible Events
Each event triggers a unique sound. If you’re caught up in your work, or in another room, you don’t have to worry about missing events.

Name Tag Integration
Snoop features automatic integration with Name Tags so you’ll know exactly who your visitors are.

I’ve been using Snoop on my Windows desktop at work for the last week or so and absolutely love it. I really wish there was some sort of interface for Linux so I could watch visitors at home. I’m NOT going to install Windows at home just so I can use Snoop, although it is tempting. 🙂

I’ve Been Reinvigorated

Reinvigorate is really nice. It’s a website statistics package, similar to Google Anlaytics and Mint. On the Reinvigorate home page, the service is described as “Measurement, performance, and regression analysis tools for evolving websites and blogs of all sizes”, sweet. Anyway, I signed up for the private beta a long time ago and finally received an invitation a few days ago.

Dougal Campbell has blogged about reinvigorate a couple times, check his posts out for some more background information on Reinvigorate.

Reinvigorated Detailed ActivityReinvigorate gives a really unique view of your website or blog, especially when it comes to tracking individual users. They also have a neat feature called “Name Tags”. Name Tags associate information on your website or blog (names, email addresses, etc) with the session id assigned by Reinvigorate. For example, this lets me track commenters based on the name they use when commenting. If someone comments, the name they used in the comment will show up in Reinvigorate. This makes it easy to see all the pages the commentor visited and how much time they spent on each page. Reinvigorate describes Name Tags as follows:

Name Tags are an easy way to identify exactly who your visitors are.

It works by associating information your site manages (username, e-mail, account ID, etc..) with the session ID Reinvigorate uses to track visitors on your site/blog.

It’s extremely simple to setup, even if your site uses its own proprietary user account system. 1-2 extra lines of code and we take care of the rest.

Reinvigorated - Plugin for WordPressName Tags are extremely simple to make use of if you use WordPress. Reinvigorate has a plugin for WordPress that makes using Name Tags a breeze. The plugin also prevents you from having to manually add the tracking code to your blog. You can turn on Name Tags right from the plugin options page. Just activate the plugin, enter your tracking id, turn Name Tags on or off, and you’re set.

I’m really happy with Reinvigorate after using it for only two days. It’s exciting to know it’s still in beta, so hopefully they’ll continue to add features and more options. One thing I would really like is the ability to select a date range to view data for. Especially for the search terms, I want to see my top search terms over certain periods of time. Same goes for popular pages too.

If you haven’t already, go sign up for the beta. You may have to wait a while for an invitation, but it’s worth the wait. I can’t wait to see what the developers have planned for Reinvigorate in the future.

Mint 2.0 Bird Feeder and WordPress

Shaun Inman has released version 2.0 of Mint, my favorite website analytics software. Go over to the Mint website and have a look at what’s new in version 2.0.

If you’re a Mint 1.x user, you’ll have to pay another $19 to make the upgrade to 2.0. I purchased the upgrade for version 2.0 earlier this week and finally got around to actually upgrading earlier today. The $19 is well worth the upgrade, Mint 2.0 brings many nice new features, like the Bird Feeder pepper for example:

Your RSS and Atom feeds attract all kinds of colorful wildlife, Bird Feeder is a window onto that activity. It highlights subscription trends across multiple Feeds and clicks on individual Seeds. What’s a seed? That’s bird-ese for an article or link within a feed.

Upgrading from Mint 1 was pretty painless, the only thing I’ve had issues with is the Bird Feeder pepper. There seems to be quite a bit of confusion about installing the Bird Feeder pepper. I haven’t really finished installing the Bird Feeder pepper, I don’t want to risk breaking my feeds. I’ve been watching this thread over at the Mint forums for tips. Recently, a forum user linked to a post by Kristin Pishdadi, who has posted a how-to for getting Bird Feeder working with WordPress 2. She spells out step by step what needs to be done to get Bird Feeder working with your WordPress feeds. Looks pretty straight forward, I wonder if it works the same if the WordPress Feedburner plugin is being used. I need to read up some on how exactly that Feedburner plugin works first I guess.

The wp-mint plugin for WordPress should still work fine with Mint 2.0. All the javascript in Mint 2.0 is included in exactly the same fashion it was in Mint 1.x, so that plugin should still work 100%.

So, if you’re having trouble getting the Bird Feeder pepper working with WordPress, go check out Kristin’s post, it’ll probably take care of your problems. It’s a lot more clear about installation than the readme that’s included with the Bird Feeder pepper. The Mint forums are an excellent resource for support issues of all types, check them out if you have problems outside the scope of Kristin’s post.

20,000 Unique

20000UniqueJust a few minutes ago, I saw 20,000 unique visitors here at longren.org. I started tracking about one year ago when I first started using Mint.

I thought it’d be 2+ years before I saw 20,000 unique visitors, guess I was way off. I never anticipated releasing a theme for WordPress or joining some of the blogging communities I’m a member of. Yay for 20,000! I’ll be at 40,000 uniques by early May, hopefully.