Sheffield Crown Court heard how Ashley Thornton, 25, lost his temper after seeing a post on Facebook on October 6 relating to a new relationship his former partner and the mother of his three-year-old child was in.
As a result, Thornton sent his ex-partner an abusive message and followed it up with a similar message sent through Facebook.
Judge Roger Thomas told the court: "Unhappiness came into the air as a result of him seeing the post.
"The next day, he turned up outside the house [of his former partner and her new boyfriend]."
The court was told how Thornton of Wingfield Road, Rotherham arrived at the property in the early hours of the morning of October 7 - and his presence was noticed by the couple who stayed in the house and refused to come outside.
Judge Thomas continued: "It must have been very frightening for them to have found you outside their house in the early hours of the morning."
Thornton pleaded guilty to one count of malicious communications and one count of affray relating to the two incidents at an earlier hearing.
Judge Thomas ordered Thornton to complete 120 hours of unpaid work, and renewed a restraining order taken out against him by his former partner.