Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save predictioniogists/6876282 to your computer and use it in GitHub Desktop.
Save predictioniogists/6876282 to your computer and use it in GitHub Desktop.
<?php
// Assuming we already have an ItemRec engine named 'appsrec'
// Get user ID and the current view's category
$uid = getUid();
$category = getCategory();
try {
// Retrieve apps recommendation for the current user and category
$command = $client->getCommand(
'itemrec_get_top_n',
array(
'pio_uid' => $uid,
'pio_engine' => 'appsrec',
'pio_n' => 10,
'pio_itypes' => $category
)
);
$result = $client->execute($command);
$recs = $result["pio_iids"];
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
show($recs);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment