Run Script with Alfred Remote
Add a "Run Script" object, and select your preffered interpreter from the dropdown menu. Paste in your script below.
You can replace the icon for it by dragging a new one on the default icon, and you can change the title below it.
For more advanced actions, take a look at Workflow Triggers.