LONDON — Claudia Weber is a seasoned commuter, and she loves to knit.

Over the past year, as her train journey from a town in the Bavarian countryside to Munich was replaced with a bus service during track repairs, stretching to two hours or more from a scheduled 40 minutes, she had a novel way of working out her frustrations.

Others may roll their eyes, shrug or post complaints on social media. When she got home each evening, she simply added two rows of wool to a striped scarf she was knitting: gray for delays under five minutes, pink for up to 30 minutes and red for a delay of more than a half-hour or delays in both directions.

The resulting four-foot “Bahn-Verspätungsschal,” or “rail delay scarf,” has become something of a social-media sensation. Put on eBay to raise money for a Germany charity that provides free assistance to people at train stations, it sold on Monday for 7,550 euros, or about $8,650, to an undisclosed buyer.

“It’s not a statistic; it’s one year and how I felt about it,” Ms. Weber, 55, an office clerk at a travel agency, said in a phone interview on Tuesday.