Install the package through Composer: run the composer require
command from the Terminal:
composer require alsoknownasdrew/remote-ok-php
require __DIR__ . '/vendor/autoload.php';
use Alsoknownasdrew\RemoteOK\Client\Factory\ClientFactory;
$client = ClientFactory::create();
Legal notice from the Remote OK API:
By using Remote OK's API feed you legally agree to mention Remote OK as a source and link back to the job listing URL on Remote OK with a DIRECT link, no redirects please. Please don't use our Remote OK and r|OK logo without written permission as they're registered trademarks. And thanks for using Remote OK! ^__^
Retrieve available positions from Remoteok.io.
$positions = $client->positions();
$client->positions()
will return an array of Position
objects.
By default, Remoteok.io API responds with a list of job positions from the last 30 days, but you can pass an optional limit argument to Client::positions()
method
$positions = $client->positions(5); // will return an array with the 5 most recent positions
Let's take a look on what's inside the client response by taking the first position from the array:
$position = $positions[0];
You can get the following properties from a Position
object: company name, company logo URL, company location, creation date, description, position ID, is position original (boolean), slug, tags, title, URL.
Get the name of the company.
$position->getCompany()->getName();
Get the full URL of the company's logo.
$position->getCompany()->getLogoUrl();
Get the location of the company.
$position->getCompany()->getLocation();
Get the creation date of the position position posting.
$position->getCreatedAt();
Get the description of the position posting.
$position->getDescription();
Get the internal ID of the position on Remoteok.io.
$position->getId();
Check whether the position posting is original, return as a boolean.
$position->isOriginal();
Get the slug of the position posting on Remoteok.io.
$position->getSlug();
Get the tags associated with the position posting.
$position->getTags();
Get the title of the position posting.
$position->getTitle();
Get the full URL of the position posting on Remoteok.io.
$position->getUrl();
Contributions are welcome. Before proceeding, please read the Code of Conduct AND Contributing guides, which contains information about contribution process.
Thanks goes to these wonderful people (emoji key):
Andriy 💻 🚧 |
Raphael 📖 💻 |
akshaythakare7 📖 |
Dario 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!