| Type: | Package | 
| Title: | Client Library for The Guardian | 
| Version: | 0.1.1 | 
| Date: | 2016-02-05 | 
| Author: | Oliver Keyes | 
| Maintainer: | Oliver Keyes <ironholds@gmail.com> | 
| Description: | A client library for 'The Guardian' (https://www.guardian.com/) and their API, this package allows users to search for Guardian articles and retrieve both the content and metadata. | 
| License: | MIT + file LICENSE | 
| Suggests: | testthat | 
| Imports: | httr, curl | 
| URL: | https://github.com/ironholds/rdian | 
| BugReports: | https://github.com/ironholds/rdian | 
| RoxygenNote: | 5.0.1 | 
| NeedsCompilation: | no | 
| Packaged: | 2016-02-05 15:23:15 UTC; ironholds | 
| Repository: | CRAN | 
| Date/Publication: | 2016-02-05 21:49:14 | 
Modern API client for The Guardian
Description
This package provides a modern (httr/curl/jsonlite-based) API client for The Guardian (https://guardian.co.uk), allowing useRs to retrieve content and content metadata.
AND and OR operators for Guardian filters and queries.
Description
guardian_and and guardian_or provide
(respectively) the AND and OR logical operators. If you pass them your
query terms, it passes them back either separated (so that the Guardian API
knows to consider a match to any one term a match) or grouped (so that
the API only matches if every term appears).
Usage
guardian_and(...)
guardian_or(...)
Arguments
| ... | a vector of terms (or several vector of terms) | 
Value
a single string containing the terms, separated by the AND (,) or OR (|) separators used by the Guardian API.
Examples
# Simple AND example
guardian_and("sausage", "mash")
# With ORs
guardian_or("sausage", "mash")
Search Guardian Content
Description
guardian_content lets you directly search
The Guardian for content, including support for conditional
searches, date-range based filtering, and section or tag
based filtering.
Usage
guardian_content(api_key, query, from = NULL, to = NULL, section = NULL,
  reference = NULL, reference_type = NULL, tags = NULL, rights = NULL,
  ids = NULL, production_office = NULL, page = NULL, page_size = 50,
  fields = NULL, collapse = TRUE, ...)
Arguments
| api_key | A key to the Guardian API, which can be obtained here. | 
| query | Your search query. This can contain operators ( | 
| from | the date to limit by. If set, the search will only cover data written after this date.
Optional (NULL) by default. Can be set in conjunction with  | 
| to | Another date to limit by. If set, the search will only cover data written before this date.
Optional (NULL) by default. Can be set in conjunction with  | 
| section | the section, or sections, of The Guardian that you want to limit the search to. Multiple
sections may be concatenated together using boolean operators; see  | 
| reference | the references to limit the search to; only articles that include those references (and meet other conditions) will be returned. Also accepts boolean operators. | 
| reference_type | the type of reference (such as  | 
| tags | the tags to limit the search to; only articles that contain these tags will be returned. Also accepts boolean operators. | 
| rights | limit a search to content with these rights (syndicatable content, for example). Options are
 | 
| ids | limit a search to content with these IDs, an ID being the standard URL fragment after  | 
| production_office | the production office(s) to limit to, such as "aus". Accepts boolean operators. | 
| page | a particular page of results to return. Useful when returning multiple sets of data with the same query;
you can repeat the query, incrementing the value in  | 
| page_size | the maximum number of items to return; anywhere between 1 and 50. Set to 50 by default. | 
| fields | additional fields to include in the returned data (when available). Possible values (which should appear in a vector) appear here. | 
| collapse | whether to collapse the actual content into a data.frame. Set to TRUE by default. | 
| ... | further arguments to pass to httr's  | 
See Also
guardian_tags to retrieve metadata about tags.
Examples
# Simple example
## Not run: 
result <- guardian_content("test", "debate AND economy")
## End(Not run)
Search Guardian Editions
Description
guardian_editions lets you directly search
The Guardian for metadata about their editions - country-specific
(or international) standard releases for their website's content.
Usage
guardian_editions(api_key, query, ...)
Arguments
| api_key | A key to the Guardian API, which can be obtained here. | 
| query | Your search query. | 
| ... | further arguments to pass to httr's  | 
See Also
guardian_sections for retrieving sections, another category
of content.
Examples
## Not run: 
# Simple example
uk_edition_data <- guardian_editions("test", "uk")
## End(Not run)
Search Guardian Sections
Description
guardian_sections lets you directly search
The Guardian for metadata about sections - individual categories of
content, such as world or US news.
Usage
guardian_sections(api_key, query, ...)
Arguments
| api_key | A key to the Guardian API, which can be obtained here. | 
| query | Your search query. This can contain operators ( | 
| ... | further arguments to pass to httr's  | 
See Also
guardian_tags for retrieving tags, another class
of content metadata.
Examples
## Not run: 
# Simple example
business_sections <- guardian_sections("test", "business")
## End(Not run)
Search Guardian Tags
Description
guardian_tags lets you directly search
The Guardian for their tags - metadata used to classify content.
Usage
guardian_tags(api_key, query, section = NULL, reference = NULL,
  reference_type = NULL, page = NULL, page_size = 50, ...)
Arguments
| api_key | A key to the Guardian API, which can be obtained here. | 
| query | Your search query. This can contain operators ( | 
| section | the section, or sections, of The Guardian that you want to limit the search to. Multiple
sections may be concatenated together using boolean operators; see  | 
| reference | the references to limit the search to; only tags that include those references (and meet other conditions) will be returned. Also accepts boolean operators. | 
| reference_type | the type of reference (such as  | 
| page | a particular page of results to return. Useful when returning multiple sets of data with the same query;
you can repeat the query, incrementing the value in  | 
| page_size | the maximum number of items to return; anywhere between 1 and 50. Set to 50 by default. | 
| ... | further arguments to pass to httr's  | 
See Also
Examples
## Not run: 
# Simple example
results <- guardian_tags("test", "green")
## End(Not run)