From How to Keep Safe from Swooping Magpies

Attach a steel nut to the end of a piece of string:

Improvise solutions:

And hide your head in shame when it is judging you: