Browse Source

feedly_entry

master
boB Rudis 4 years ago
parent
commit
83a41922c9
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 6
      DESCRIPTION
  2. 1
      NAMESPACE
  3. 3
      NEWS.md
  4. 44
      R/feedly-entry.R
  5. 1
      README.Rmd
  6. 7
      README.md
  7. 19
      man/feedly_entry.Rd

6
DESCRIPTION

@ -1,8 +1,8 @@
Package: seymour
Type: Package
Title: Tools to Work with the 'Feedly' 'API'
Version: 0.2.5
Date: 2019-12-03
Version: 0.3.0
Date: 2020-01-22
Authors@R: c(
person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-5670-2640"))
@ -32,4 +32,4 @@ Imports:
utils,
jsonlite,
magrittr
RoxygenNote: 7.0.1
RoxygenNote: 7.0.2

1
NAMESPACE

@ -6,6 +6,7 @@ export(feedly_categories)
export(feedly_collections)
export(feedly_continue)
export(feedly_enterprise_profile)
export(feedly_entry)
export(feedly_feed_meta)
export(feedly_opml)
export(feedly_profile)

3
NEWS.md

@ -1,3 +1,6 @@
0.3.0
* Added `feedly_entry()`
0.2.0
* Added package user agent to API calls
* Added `feedly_categories()` utility function

44
R/feedly-entry.R

@ -0,0 +1,44 @@
#' Get the content of an entry
#'
#' An entry is the atomic unit of content in the feedly cloud.
#'
#' @md
#' @param entry_id the unique, immutable ID for this particular article.
#' @param feedly_token Your Feedly Developer Access Token (see [feedly_access_token()])
#' @references (<https://developer.feedly.com/v3/entries/>)
#' @export
feedly_entry <- function(entry_id, feedly_token = feedly_access_token()) {
httr::GET(
.seymour_ua,
url = sprintf("https://cloud.feedly.com/v3/entries/%s", entry_id[1]),
httr::add_headers(
`Authorization` = sprintf("OAuth %s", feedly_token)
)
) -> res
httr::stop_for_status(res)
out <- httr::content(res, as="text")
out <- jsonlite::fromJSON(out)
if (inherits(out, "data.frame")) {
if (nrow(out) > 0) {
cn <- colnames(out)
if ("recrawled" %in% cn) out$updated <- as.POSIXct(out$recrawled/1000, origin = "1970-01-01")
if ("updated" %in% cn) out$updated <- as.POSIXct(out$updated/1000, origin = "1970-01-01")
if ("crawled" %in% cn) out$crawled <- as.POSIXct(out$crawled/1000, origin = "1970-01-01")
if ("published" %in% cn) out$published <- as.POSIXct(out$published/1000, origin = "1970-01-01")
if ("actionTimestamp" %in% cn) out$actionTimestamp <- as.POSIXct(out$actionTimestamp/1000, origin = "1970-01-01")
class(out) <- c("tbl_df", "tbl", "data.frame")
}
}
out
}

1
README.Rmd

@ -25,6 +25,7 @@ The following API functions are implemented:
- `feedly_access_token`: Retrieve the Feedly Developer Token
- `feedly_collections`: Retrieve Feedly Connections
- `feedly_categories`: Show Feedly Categories
- `feedly_entry`: Get a single entry by id
- `feedly_enterprise_profile`: Retrieve Your Feedly Enterprise Profile
- `feedly_feed_meta`: Retrieve Metadata for a Feed
- `feedly_opml`: Retrieve Your Feedly OPML File

7
README.md

@ -21,6 +21,7 @@ The following API functions are implemented:
- `feedly_access_token`: Retrieve the Feedly Developer Token
- `feedly_collections`: Retrieve Feedly Connections
- `feedly_categories`: Show Feedly Categories
- `feedly_entry`: Get a single entry by id
- `feedly_enterprise_profile`: Retrieve Your Feedly Enterprise Profile
- `feedly_feed_meta`: Retrieve Metadata for a Feed
- `feedly_opml`: Retrieve Your Feedly OPML File
@ -74,7 +75,7 @@ library(tidyverse) # mostly for printing
packageVersion("seymour")
```
## [1] '0.2.5'
## [1] '0.3.0'
### Collections
@ -333,8 +334,8 @@ cloc::cloc_pkg_md()
| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) |
| :--- | -------: | ---: | --: | ---: | ----------: | ---: | -------: | ---: |
| R | 24 | 0.96 | 488 | 0.92 | 184 | 0.78 | 404 | 0.83 |
| Rmd | 1 | 0.04 | 40 | 0.08 | 52 | 0.22 | 84 | 0.17 |
| R | 25 | 0.96 | 512 | 0.93 | 195 | 0.79 | 413 | 0.83 |
| Rmd | 1 | 0.04 | 40 | 0.07 | 52 | 0.21 | 85 | 0.17 |
## Code of Conduct

19
man/feedly_entry.Rd

@ -0,0 +1,19 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/feedly-entry.R
\name{feedly_entry}
\alias{feedly_entry}
\title{Get the content of an entry}
\usage{
feedly_entry(entry_id, feedly_token = feedly_access_token())
}
\arguments{
\item{entry_id}{the unique, immutable ID for this particular article.}
\item{feedly_token}{Your Feedly Developer Access Token (see \code{\link[=feedly_access_token]{feedly_access_token()}})}
}
\description{
An entry is the atomic unit of content in the feedly cloud.
}
\references{
(\url{https://developer.feedly.com/v3/entries/})
}
Loading…
Cancel
Save