The first ability will keep putting cards from the top of your library into your graveyard until you reveal a nonland card. That nonland card remains on top of your library.

4/1/2008

Each time you put a land card into your graveyard with the first ability, the second ability will trigger. Those triggers wait to be put onto the stack until the first ability has completely finished resolving.