Finely chop the onion and green onion.
Beat the eggs and set aside.
Heat cooking oil in a pan and stir-fry the onion and green onion.
Add the rice and stir-fry.
Add the eggs and stir-fry, mixing evenly.
Add ketchup and quickly mix and stir-fry to finish.