Preheat oven to 350 degrees F (175 degrees C). Spread pine nuts on a baking sheet.
Toast in the preheated oven until golden brown, about 12 minutes.
Melt butter in a saucepan over medium-low heat. Increase heat to medium and stir in spaghetti; cook until coated with melted butter and lightly browned, 3 to 5 minutes. Add onion and garlic; cook until tender, about 2 minutes. Stir in rice; cook for 5 minutes.
Pour broth into the saucepan. Bring to a boil; cover and cook until rice is tender until liquid has been absorbed, about 20 minutes. Season with salt and pepper.
Mix toasted pine nuts and parsley into the rice mixture.