Created
January 13, 2023 22:21
-
-
Save alecbw/8f5a0c41d2d5c8340c5eea16cb52804a to your computer and use it in GitHub Desktop.
Revisions
-
alecbw renamed this gist
Jan 13, 2023 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
alecbw created this gist
Jan 13, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ <?php function fetch_jobs() { $api_key = getenv("SOURCESTACK_KEY"); $data = array( "export" => "caller", "limit" => 100, "fields" => ["post_url", "company_url", "job_name", "company_name", "job_location", "hours", "department", "seniority", "remote", "tags_matched", "tag_categories", "last_indexed", "post_html"], "filters" => array(array("field" => "job_name", "operator" => "CONTAINS_ANY", "value" => ["SEO", "Content Market", "Digital Market"])) ); $options = array( 'http' => array( 'header' => "Content-type: application/json\r\n" . "X-API-KEY: $api_key\r\n", 'method' => 'POST', 'content' => json_encode($data), ), ); $context = stream_context_create($options); $response = file_get_contents("https://sourcestack-api.com/jobs", false, $context); return json_decode($response, true); }