function shurly_service_output_txt in ShURLy 7
Same name and namespace in other branches
- 8 shurly_service/shurly_service.inc \shurly_service_output_txt()
- 6 shurly_service/shurly_service.inc \shurly_service_output_txt()
Output txt data Just outputs the shortUrl attribute... won't show errors
File
- shurly_service/
shurly_service.inc, line 113 - Link general search functionalities to services module.
Code
function shurly_service_output_txt($data) {
// sniff the URL and figure out what to output
switch (arg(2)) {
case 'expand':
$key = 'longUrl';
break;
case 'shorten':
default:
$key = 'shortUrl';
}
if ($data['success']) {
print $data[$key];
}
else {
print t("ERROR: !error", array(
'!error' => $data['error'],
));
}
}