Drinklogs Blog

Updates for Drinklogs.com 

New Feature: Drinklogs iPhone Interface

Now that so many people around me have iPhones I finally made an interface just for them! You can try it out the Drinklogs iPhone interface and let me know what you think. At the moment you can only search and take drinks but this week I am working on GPS locations, ratings, and comments. You can't sign up though there yet either but if you are new you can signup to Drinklogs on the usual page. 

This was done with the JQTouch plugin for JQuery. I was never much a fan of Javascript but this is quite easy to make rather detailed web apps and kind of makes me want to buy an iPhone. Since there seems to be such a small amount of writing about JQTouch available I will see if I can put up a short tutorial about what I've done. 

Filed under  //   Feature   JQTouch   JQuery   Javascript   iPhone  

New Feature: Drink Recommendations!

I brought back drink recommendations now that it works correctly. You can access your drink recommendations by going to your home page. On each beverage page there will also be related beverages based on user ratings.

This is all based on your beverage ratings though! If you want more accurate recommendations you need to rate the beverages you've had! You can rate them even if you haven't logged them as well.

Recommendations are provided by the Directed Edge API which is really awesome and you should all check out if you need recommendations!

Filed under  //   Directed Edge   Feature   Recommendations  

Upgraded Server!

One of the largest limiting factors in the development of Drinklogs is the amount of memory available on the server. The server and background processors are written in Python so each process uses a fair bit of memory which filled up most of the Slicehost instance I was using. 

Recently Slicehost added some new slice sizes including one between the 256MB and 512MB options. The price increase for a 512 instance wasn't worth it to me but now with a 384MB instance for only $5 more I decided to upgrade. 

I'm now able to run 4 FCGI processes with all of the background processors and still have memory left over! Page load times haven't changed much but it should prevent the 5+ second page loads when memory filled up.

Filed under  //   Memory   Python   Slicehost  

Current Architecture

There are a few things to note about the current setup of Drinklogs that may be of interest. I will describe some of the setup of the current system with follow-up posts about how to do something similar on your own.

Hosting is provided by Slicehost with a 256MB Ubuntu slice. I also use this slice for personal projects and git hosting. At $25 a month with backups it is well worth the money. 

The current web server is Lighttpd as it is the recommended setup with Web.py. I have two FCGI processes for Drinklogs out of 3 running on the server and an additional static site. 

The database is MySQL. I use this only out of habit although I have some experience with Oracle. Recently the site was ported to SQLAlchemy from the Web.py database library. As the site grew my own convenience methods started turning into my own ORM and it was finally time to learn/use SQLAlchemy. 

The web processes send messages through a RabbitMQ server to a few sets of pollers to handle asynchronous processes. At the moment there are three:

  • Outbound emailer for account resets and eventual weekly updates.
  • Mixpanel analytic updates via API
  • Twitter Bot for new drinks.
These pollers run separately through Supervisord which is quite helpful and will probably be the next subject of a post. 

 

Filed under  //   Mixpanel   MySQL   RabbitMQ   SQLAlchemy   Slicehost   Supervisord   Twitter   Web.py  

Twitter Integration!

After a bit of work I was able to add a Twitter component to Drinklogs! Now you can easily add drinks to the site while out and about as long as you have your phone. Simply send a formatted tweet to @drinklogs and you will have a single click way to add the drink!

You'll need to format your tweet as :

[Drink] @ [Location] @drinklogs

Such as :

Yuengling @ Home @drinklogs

When you log in go to the link "Drink Tweets!" from your profile to view the tweet along with the drink and location after you enter your Twitter username. From there you can click one button and turn it into a drink. 

If it isn't right... well that isn't so good yet. You can mark the tweet read and add the drink yourself. 

Filed under  //   Twitter   Yuengling  

Drinklogs Timeline on Personal Home Page

Timeline

2 days ago - karen had 1 drink of North Coast Brewing Co. Pranqster on 2009-12-06

2 days ago - karen had 1 drink of Konig Ludwig Schlossbrauerei Konig Ludwig Weissbier on 2009-08-01

2 days ago - karen had 1 drink of Moctezuma Brewery Dos Equis on 2009-07-31

At the moment it only has your friends drinks but it will soon have friendings and wish list items!

Filed under  //   Home   Timeline   Wishlist  

New Database Layer

I spent most of the snowed in weekend working to rewrite the Web.py database layer into one using SQLAlchemy. It was definitely worth learning and hopefully this should help me make future changes even faster.

Sadly in the conversion I lose a bit of caching but make up for it with fewer SQL queries. As I tune the site more I should be able to find the problem spots and improve it where possible. The site should be fast enough to use though. 

There are still some spots using the old way although this was enough to push live and test. If you notice any problems leave a comment!

Filed under  //   Caching   SQL   SQLAlchemy   Web.py  

Auto-escaping Values

I have worked on some back-end things for escaping all user-submitted values. If you see any weird character-encoding issues please let me know or leave a comment!

Filed under  //   Character Encoding   Web-safe  

Cleaning Up The Data

I've written some updates on the server to help me clean up the database. After an import of beer data from around the web it was left in a rather poor state. 

At the moment I am just combining duplicate producers, eventually I will merge beverages as well. All the previous links will redirect properly and I have no intention of ever breaking those links. 

 

Filed under  //   Database   Update  

New Home Location!

The most requested feature has been implemented! Possibly not the most requested, but one that has been the question I receive by a few people: "How do I have a drink at home?" 

Now after setting the number and date of your drinking your home location will be available! This location is private and won't contain any address information or maps. Eventually you will be able to drink at your friend's home locations as well. 

If you want to go back and set previous drinks to home you can do so through the "See All Drinks" link on your profile.

 

Happy Drinking!

Filed under  //   Feature   Home   Locations