Careerjet genel arama API'i için php arayüzü
Buradaki kolay kullanımlı PHP modülünü kullanarak web sitenizde Careerjet iş arama sonuçlarını yayımlayabilirsiniz.
Kurulum
Eğer PHP'nin 5.2 den önceki versiyonunu kullanıyor iseniz json u aşağıdaki komut ile yüklemeniz gerekmektedir
pear install json
ve aynı zamanda php.ini dosyanızın şu satırı içerdiğine emin olunuz
extension=json.so
Aksi taktirde tek yapmanız gereken bilgisayarınıza indirmektir Services_Careerjet.zip ve scriptlerinizin bulabileceği bir dizine açınız:
cd my_application_directory wget http://www.careerjet.co.uk/devel/Services_Careerjet.zip unzip Services_Careerjet.zip
Belgeler
Daha fazla detay için lütfen Services_Careerjet.php kodlarında yer alan belgelere göz atınız.
Örnek kod
<?php
require_once "Services_Careerjet.php" ;
$api = new Services_Careerjet('en_GB') ;
$page = 1 ; # Or from parameters.
$result = $api->search(array( 'keywords' => 'php developer',
'location' => 'London',
'page' => $page ,
)
) ;
if ( $result->type == 'JOBS' ){
echo "Found ".$result->hits." jobs" ;
echo " on ".$result->pages." pages\n" ;
$jobs = $result->jobs ;
foreach( $jobs as $job ){
echo " URL: ".$job->url."\n" ;
echo " TITLE: ".$job->title."\n" ;
echo " LOC: ".$job->locations."\n";
echo " COMPANY: ".$job->company."\n" ;
echo " SALARY: ".$job->salary."\n" ;
echo " DATE: ".$job->date."\n" ;
echo " DESC: ".$job->description."\n" ;
echo "\n" ;
}
# Basic paging code
if( $page > 1 ){
echo "Use \$page - 1 to link to previous page\n";
}
echo "You are on page $page\n" ;
if ( $page < $result->pages ){
echo "Use \$page + 1 to link to next page\n" ;
}
}
# When location is ambiguous
if ( $result->type == 'LOCATIONS' ){
$locations = $result->solveLocations ;
foreach ( $locations as $loc ){
echo $loc->name."\n" ; # For end user display
## Use $loc->location_id when making next search call
## as 'location_id' parameter
}
}
?>
