[ic] Selling the output of a program

Christopher Wenham cwenham at synesmedia.com
Thu Apr 1 14:14:57 EST 2004

On Thursday 01 April 2004 10:44, Michael Hess wrote:
> I have a shell script that when someone buys something, I would like to
> pass it the sku, and have it return a string.  Is there an easy way to do
> this with IC, I am not really a programer, but I will try, can someone
> point me in the right direction?

 You'll need to use a Global UserTag to call the shell script, because 
Interchange will otherwise trap it for the sake of security.

 In your Interchange's installation directory, look for a file called 
code/UserTag/fortune.tag for an example of how to call a program and pass it 
arguments, then read its output and return it as the output of the tag.

 I'd start by copying fortune.tag and renaming it, also changing all the 
instances of "UserTag fortune" to "UserTag mytag" or whatever.

 Then change this line:

my $cmd = $Global::Variable->{MV_FORTUNE_COMMAND} || '/usr/games/fortune';

 To something like:

my $cmd = '/path/to/my/shell/script';

 Then all you have to do is call " [mytag] " from someplace after the checkout 
page, like receipt.html

Chris Wenham - Synesmedia, Inc.
516-620-4110 / 1-888-255-7573

More information about the interchange-users mailing list