Fetching Views 3 implementation from code
There are quite some different ways to achieve this


Use the ctools bulk export module, this will provide you some example code to use
use the features module, which gives you a full module