Archive for November, 2007

Recipe: Salmon Papillotes

Wednesday, November 7th, 2007

Megen cooked up an amazing meal the other day and I wanted to share. Cooking “en papillote” is a technique where you place your food in a folded piece of parchment paper and bake it. The pouch keeps in all of the moisture and steams the food. This results in a very moist and aromatic meal that is exciting to open.  Here is the recipe we followed:

You’ll need:

  • 1 1/2 lb of salmon fillets
  • 1 fennel bulb
  • 3 carrots
  • 1/2 lb red potatoes
  • 1/2 cup Kalamata olives, sliced
  • Thyme (4 teaspoons), garlic (2 gloves minced), lemon juice, and olive oil (3 tablespoons)

Instructions:

  1. Preheat oven to 400°F.
  2. Thinly slice the fennel, carrots, and potatoes in 1/8 inch thick slices.
  3. Blanch each vegetable (separately) in salted water. Fennel for 2 minutes, carrots for 1, potatoes for 2. Put the fennel and carrots in an ice bath and then drain. The potatoes can just be drained (no ice bath needed).
  4. Toss the fennel and carrots with olives, lemon juice, thyme, half of the garlic, 2 tablespoons olive oil, and salt and pepper to taste.
  5. Toss potatoes with the rest of the garlic and olive oil.
  6. Divide the potatoes onto the parchment paper.
  7. Place the salmon (seasoned with salt and pepper) on top of the potatoes.
  8. Top the salmon with the fennel and carrot mixture.
  9. Gather the parchment paper and fold to form a pouch; it needs to be tight. We forgot to get string to tie it together so we just used another piece of parchment paper on the top tucked underneath the pouch. This worked well for us.
  10. Place the pouches on a baking sheet and bake for 20 minutes.

Opening the pouch at the dinner table is a lot of fun and it smells amazing:

The end result:

BeautifulSoup: Last.fm Artist Image

Wednesday, November 7th, 2007

A coworker had been working with Last.fm and libnotify to send him a notification when a friend listens to a song so that he can decide if he’d be interested in listening to it. To grab the artist’s image he used a complex regular expression that was prone to error. I thought it was a neat idea so I decided to implement for my stream. The result can be found here.

My implementation is a one liner:

event.image = soup.find('div', {'class': 'imgHolder'}).find('img').get('src')

Basically that says “find the div that has a class imgHolder, find the image inside of that div, and get me the link to the image”. BeautifulSoup makes things like this extremely easy. I highly recommend using it whenever you need to screen scrape.

Pop Secrets Updated

Tuesday, November 6th, 2007

I wrote the original script for Pop Secrets over a year ago. Back then I was just getting into Python and was woefully ignorant. Using Universal Feed Parser I simply gobbled up all the content from a number of celebrity gossip blogs and spitted them out sorted by date onto a page. It was a complete hack; 129 lines of Python that was a complete mix of presentation, data, and logic. Despite all of that it still attracted a steady flow of about 250 unique visitors a month. Not bad but nobody was clicking on the Google ads and because the site consisted of a single static file I basically got 1 page view per visit.

Yesterday I rewrote Pop Secrets using Django, it took me a total of about 2 hours to finish and most of that was template design; Django is really that fast. From the outside the site looks the same except I’ve added pagination (3 posts per page) and you can view posts from a single source or tag. Internally I’m doing a lot more magic. I use BeautifulSoup to extract images from a post. This allows me to strip all the html from the content (don’t trust anything on the Internet!) but still keep the images (which is the main reason people visit these sites). Tags allow you to view all stories, across all sites, specific to a certain topic (Britney Spears for instance).

My logs show that people like the new version. I’ve gotten as many unique visitors in 1 day as I used to get in 1 month. People are making use of the tag and single source views. I’ve got an average of 18 page views per visit; people love clicking that “Next Page” button. I’m entertaining the idea of adding commenting; but I’m not sure people would use it since the gossip blogs already provide that feature.

If you came here from Pop Secrets: let me know what you think of it and if there is anything I can do to make it better for you.

Recipe: Skate with Browned Butter and Capers

Thursday, November 1st, 2007

Megen’s favorite fish, skate, has become the tastiest dish in our house. Skate has a very sweet taste similar to scallops but at a fraction of the cost. We’ve made this recipe a few times now and it never disappoints:

  1. Thaw (if frozen), rinse, and dry off your skate fillets.
  2. Salt and pepper one side of each fillet.
  3. Dredge the fillet in flour. It only needs to be lightly covered so make sure to remove any extra flour.
  4. Heat 1 tablespoon of olive oil in a pan over medium heat.
  5. Place the fillet in the pan and watch out for curling. Skate fillets tend to curl (more so if the heat is too high or the fillet too small) and can get to the point where it curls completely up. While it would still taste delicious, it wouldn’t look all that appetizing. If it starts to curl just hold it down with a spatula until it calms down.
  6. Cook the fillet for about 2 to 3 minutes per side. You want it nice and golden brown.
  7. Place the fillet on a paper towel to drain off the excess oil.
  8. Repeat 5 – 7 for each fillet. Add another tablespoon of oil if you need it.
  9. Place 2 tablespoons of butter in the pan and cook it until it is brown. Remove the pan from the heat, add in 2 tablespoons of capers, and drizzle the butter over the capers.

The end result: