Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-08-02 04:25:14

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

adi_webhook - Webhooker

Summary

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.

See the help supplied with the plugin, or have a look online. You can download the latest version from here.

adi_webhook was created in response to a request from Gary (giz) to process MailChimp callbacks.

Example

<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

Requirements

No special requirements.

Version history

  • 0.1
    • initial release

Feedback

Comments are most welcome.

Developers fund

If you find this plugin useful, please consider donating to the Textpattern development team.

Offline

#2 2016-08-02 18:48:45

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 304
Website GitHub Twitter

Re: adi_webhook - Webhooker

Thanks Adi, works a treat :)

Offline

Board footer

Powered by FluxBB