You can incorporate REST services into BMP Interactions
Code Block |
---|
theme | RDark |
---|
language | xml |
---|
title | Input Arguement |
---|
linenumbers | true |
---|
|
<arg>
<prefix>Latitude:</prefix>
<preload>-33.42</preload>
</arg>
<arg>
<prefix>{NL}Longitude:</prefix>
<preload>151.34</preload>
</arg> |
Code Block |
---|
theme | RDark |
---|
language | php |
---|
title | Sample Interaction Code |
---|
linenumbers | true |
---|
|
$debug = true;
$str = '';
$url = 'http://api.geonames.org/countryCode?lat=' . $args[0] . '&lng='
. $args[1] . '&username=demo&type=JSON';
$t->fetch($url);
$data = json_decode($t->result, true);
if($debug)
$str = "URL: {$url}<br /><br />
JSON: {$t->result}<br /><br />";
return $str . "Country name is {$data[countryName]}
<br />Country code is {$data[countryCode]}"; |
...