This circuit, enclosed into a small box, is placed in the fridge near the lamp (if any) or the opening. With the door closed the interior of the fridge is in the dark, the photo resistor R2 presents a high resistance (up to 200K) thus clamping IC1 by holding pin 12 high. When a beam of light enters from the opening, or the fridge lamp illuminates, the photo resistor lowers its resistance (less 2K), pin 12 goes low, IC1 starts counting and, after a preset delay (20 seconds in this case) the piezo sounder beeps for 20 sec. then stops for the same lapse of time and the cycle repeats until the fridge door closes. D2 connected to pin 6 of IC1 allows the piezo sounder beeping 3 times per second.
circuit from http://www.extremecircuits.net/2009/08/fridge-door-alarm-circuit_21.html