Textpattern CMS support forum
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,224
adi_webhook - Webhooker
adi_webhook provides a mechanism to easily implement webhooks on Textpattern websites. It waits for incoming connections and, if URL variables (and values) match predefined settings, will execute the code of your choice.
It’s a bit like adi_gps in that it takes notice of URL vars, but unlike adi_gps it provides a mechanism to selectively act on the data received.
adi_webhook was created in response to a request from Gary (giz) to process MailChimp callbacks.
<txp:adi_webhook name="myvar1" value="myval1"> <txp:adi_webhook_action name="myvar2"> <txp:adi_webhook_log msg="*** MYVAR2 FOUND **" /> MYVAR2 = <txp:adi_webhook_variable name="myvar2" /> <txp:adi_webhook_if_variable name="myvar2" value="myval2"> DO THIS ... <txp:else /> DO SOMETHING ELSE ... </txp:adi_webhook_if_variable> </txp:adi_webhook_action> </txp:adi_webhook>
In the above example:
- adi_webhook will wait for an incoming connection containing var ‘myvar1’ that has a value of “myval1”
- if the connection contains var ‘myvar2’ as well, the tags enclosed by adi_webhook_action are executed – i.e. a diagnostic message generated, & the value of ‘myvar2’ output
- in addition, the value of ‘myvar2’ is tested for further processing
No special requirements.
- initial release
Comments are most welcome.
If you find this plugin useful, please consider donating to the Textpattern development team.