Wydawcy stron

Interfejs API wyszukiwarki pracy Careerjet dla .NET / ASP.NET

Poniżej znajdują się instrukcje dotyczące integracji API wyszukiwarki pracy Careerjet dla aplikacji .NET lub na stronach ASP.NET.

Zgodność

Asemblację kodu Careerjet przeprowadzono dla .NET 2.0.

Zależności

Asemblacja kodu Careerjet zależy od asemblacji .NET 2.0 Json.NET (patrz załączony plik zip).

Instalacja

Pobierz plik WebServiceCareerjet.zip. Zawiera on dwa pliki dll:

WebService.Careerjet.Client.dll
Newtonsoft.Json.Net20.dll

Upewnij się, że te pliki dll są związane z aplikacją .NET i (lub) stronami ASP.NET.

Dokumentacja

Dokumentacja dotycząca asemblacji jest dostępna tutaj.

Przykład tekstu

Poniżej znajduje się przykład strony ASP.NET napisanej w języku C#:

 
<%@ Page Language="C#" %>
<%@ Import Namespace="WebService.Careerjet" %>
<%@ Import Namespace="Newtonsoft.Json.Linq" %>
<html>
<head>
   <title>My ASPx test</title>
</head>
<body>
 <% 
WebService.Careerjet.Client c = new WebService.Careerjet.Client("en_GB");
Hashtable cargs = new Hashtable() ;
cargs.Add("keywords" , "sales manager");
cargs.Add("location" , "london");
cargs.Add("pagesize" , "2" );

JObject res = c.Search(cargs);
 
if( res.Value<string>("type").Equals("JOBS")){
%>
<h1><% Response.Write(res["hits"]); %> jobs
found on <%  Response.Write(res["pages"]); %> pages.</h1>
<%
 foreach( JToken job in res["jobs"].Children()){
%>
<div>
  <h3><a href="<% Response.Write(job.Value<string>("url"));%>">
  <% Response.Write(job.Value<string>("title")); %>
  </a></h3>

  <div><% Response.Write(job.Value<string>("date"));%></div>
  <div><% Response.Write(job.Value<string>("locations"));%></div>
  <div><% Response.Write(job.Value<string>("salary"));%></div>
  <div><% Response.Write(job.Value<string>("company"));%></div>
  <div><% Response.Write(job.Value<string>("description"));%></div>
  <div><% Response.Write(job.Value<string>("site"));%></div>
</div>
<%
 } // End of jobs loop
} // End of if JOBS
if( res.Value<string>("type").Equals("LOCATIONS")){
%>
 <h3>Ambiguous location</h3>
<%
  foreach( JToken location in res["solveLocations"].Children()){
%>
  <div>
    <span><% Response.Write(location.Value<string>("name")); %></span>
    <span><% Response.Write(location.Value<string>("location_id")); %></span>
  </div>
<%
  } // End of locations loop
} // End of if LOCATIONS
%>
 
</body>
</html>