Retrieves the item corresponding to specified id using Hacker News API
get_item_by_id(id)
Arguments
id: id of the item that should be retrieved
Returns
item corresponding to the specified id
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.
Examples
# retrieve the id of the latest Hacker News itemlast_item_id <- get_max_item_id()last_item_id
# retrieve the latest Hacker News itemlast_hn_item <- get_item_by_id(last_item_id)last_hn_item