Ciao raga', sto lavorando a un blog in wordpress in locale e voglio visualizzare degli annunci di lavoro tramite l'integrazione delle API di careerjet.it. Sono riuscito a visualizzare gli annunci nel mio blog ma non riesco a far funzionare la paginazione, ovvero - Pagina indietro 1,2,3,4... Pagina avanti - AIUTOO
Grazie a tutti!
http://www.careerjet.it/partners/api/php/Careerjet_API.zip
Grazie a tutti!
PHP:
<?php
require_once "Careerjet_API.php" ;
$api = new Careerjet_API('en_GB') ;
$page = 1 ; # Or from parameters.
$result = $api->search(array( 'keywords' => 'php developer',
'location' => 'italy',
'page' => $page ,
'affid' => 'xxxxxxxxxxxxxxxxx',
)
) ;
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
}
}
?>
http://www.careerjet.it/partners/api/php/Careerjet_API.zip