2017 © Pedro Peláez
 

library hn-api-php

A PHP wrapper for the Hacker news API, using Guzzle

image

mgerarts/hn-api-php

A PHP wrapper for the Hacker news API, using Guzzle

  • Monday, November 27, 2017
  • by mark-gerarts
  • Repository
  • 1 Watchers
  • 0 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 213 % Grown

The README.md

HackerNewsApi

A HN Api client wrapper for PHP, built to experiment with Guzzle services., (*1)

Installation

The package is available through composer:, (*2)

$ composer require mgerarts/hn-api-php

Usage

The client is a wrapper around a Guzzle service definition. It can be instantiated like this:, (*3)

<?php

use HackerNewsApi\Service\HackerNewsServiceClient;
use HackerNewsApi\Client\HackerNewsClient;

$client = new HackerNewsClient(HackerNewsServiceClient::create());

You can then start making requests:, (*4)

<?php

$client->getItem(8863);

// Will return:
// HackerNewsApi\Models\Item {#70
//   -id: 8863
//   -deleted: false
//   -type: "story"
//   -by: "dhouston"
//   -time: 1175714200
//   -text: null
//   -dead: false
//   -parent: null
//   -poll: null
//   -kids: array:33 [..]
//   -url: "http://www.getdropbox.com/u/2/screencast.html"
//   -score: 111
//   -title: "My YC app: Dropbox - Throw away your USB drive"
//   -parts: []
//   -descendants: 71
// }

A full list of available methods can be found here., (*5)

The Versions

27/11 2017

dev-master

9999999-dev

A PHP wrapper for the Hacker news API, using Guzzle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mark Gerarts

api hacker news

28/05 2017

v1.0.2

1.0.2.0

A PHP wrapper for the Hacker news API, using Guzzle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mark Gerarts

api hacker news

28/05 2017

v1.0.1

1.0.1.0

A PHP wrapper for the Hacker news API, using Guzzle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mark Gerarts

api hacker news

28/05 2017

v1.0.0

1.0.0.0

A PHP wrapper for the Hacker news API, using Guzzle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Mark Gerarts

api hacker news