Permalink
Browse files

Added soc to vacancy count.

  • Loading branch information...
1 parent 2058915 commit d1e5ab15db918c8987cd9f1f3cab98393fc29f0a @46bit committed Mar 20, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 helper.php
View
@@ -70,4 +70,19 @@ function coords_to_jcp ($coords) // expects non-associative lat/lng array as giv
{
$lookup = ukces_api('/jcp/geosearch?lat=' . rawurlencode($coords[0]) . '&long=' . rawurlencode($coords[1]));
return $lookup->result[0]->office_code;
+}
+
+function soc_to_vacancy_count ($soc, $jcp = FALSE, $trimSoc = 3)
+{
+ if ($trimSoc)
+ {
+ $soc = substr($soc, 0, $trimSoc);
+ }
+ $endpoint = '/jcp/vacancies/' . rawurlencode($soc);
+ if ($jcp)
+ {
+ $endpoint .= '?offices=' . rawurlencode($jcp);
+ }
+ $lookup = ukces_api($endpoint);
+ return count($lookup->result);
}

0 comments on commit d1e5ab1

Please sign in to comment.