Beat the eggs and set aside.
Finely chop the onion and green onion.
Heat oil in a pan and scramble the eggs.
Take out the eggs and sauté the onion and green onion in the same pan.
Add rice and stir-fry with the ingredients.
Mix in the scrambled eggs.
Add ketchup and stir-fry evenly.
Check the seasoning and finish.