get_item_by_id: Get Hacker News by Id

Description Usage Arguments Details Value Examples

View source: R/api.R

Description

Retrieves the item corresponding to specified id using Hacker News API

Usage

1

Arguments

id

id of the item that should be retrieved

Details

The API in some cases returns a null response. When this situation occurs it is assumed that the item does not exist and NA is returned.

Value

item corresponding to the specified id

Examples

1
2
3
4
5
6
7
# retrieve the id of the latest Hacker News item
last_item_id <- get_max_item_id()
last_item_id

# retrieve the latest Hacker News item
last_hn_item <- get_item_by_id(last_item_id)
last_hn_item

hackeRnews documentation built on Dec. 16, 2019, 1:24 a.m.