Package 'rfoaas'

Title: R Interface to 'FOAAS'
Description: R access to the 'FOAAS' (F... Off As A Service) web service is provided.
Authors: Dirk Eddelbuettel [aut, cre]
Maintainer: Dirk Eddelbuettel <[email protected]>
License: GPL (>= 2)
Version: 2.3.2.1
Built: 2024-10-28 16:18:35 UTC
Source: https://github.com/eddelbuettel/rfoaas

Help Index


R Interface to FOAAS

Description

The FOAAS service is provided as a modern, RESTful, scalable solution. This package provides an R interface.

Usage

off(name, from, filter, language)
  you(name, from, filter, language)
  this(from, filter, language)
  that(from, filter, language)
  everything(from, filter, language)
  everyone(from, filter, language)
  donut(name, from, filter, language)
  shakespeare(name, from, filter, language)
  linus(name, from, filter, language)
  king(name, from, filter, language)
  pink(name, filter, language)
  life(name, filter, language)
  chainsaw(name, from, filter, language)
  outside(name, from, filter, language)
  thanks(from, filter, language)
  fascinating(from, filter, language)
  madison(name, from, filter, language)
  cool(from, filter, language)
  field(name, from, reference, filter, language)
  nugget(name, from, filter, language)
  yoda(name, from, filter, language)
  ballmer(name, company, from, filter, language)
  what(from, filter, language)
  because(from, filter, language)
  caniuse(tool, from, filter, language)
  bye(from, filter, language)
  diabetes(from, filter, language)
  bus(from, filter, language)
  xmas(name, from, filter, language)
  awesome(from, filter, language)
  tucker(from, filter, language)
  bucket(from, filter, language)
  bday(name, from, filter, language)
  family_(from, filter, language)
  shutup(name, from, filter, language)
  zayn(from, filter, language)
  keepcalm(reaction, from, filter, language)
  dalton(name, from, filter, language)
  dosomething(do, something, from, filter, language)
  off_with(name, from, filter, language)
  retard(from, filter, language)
  thumbs(name, from, filter, language)
  back(name, from, filter, language)
  bm(name, from, filter, language)
  gfy(name, from, filter, language)
  greed(something, from, filter, language)
  me(from, filter, language)
  mornin(from, filter, language)
  think(name, from, filter, language)
  keep(name, from, filter, language)
  single_(from, filter, language)
  look(name, from, filter, language)
  looking(from, filter, language)
  no(from, filter, language)
  give(from, filter, language)
  zero(from, filter, language)
  pulp(name, from, filter, language)
  sake(from, filter, language)
  anyway(name, from, filter, language)
  maybe(from, filter, language)
  blackadder(name, from, filter, language)
  horse(from, filter, language)
  deraadt(name, from, filter, language)
  problem(name, from, filter, language)
  cocksplat(name, from, filter, language)
  too(from, filter, language)
  thing(name, from, filter, language)
  asshole(from, filter, language)
  cup(from, filter, language)
  fyyff(from, filter, language)
  immensity(from, filter, language)
  programmer(from, filter, language)
  rtfm(from, filter, language)
  thinking(name, from, filter, language)
  bag(from, filter, language)
  equity(name, from, filter, language)
  fts(name, from, filter, language)
  ing(name, from, filter, language)
  particular(name, from, filter, language)
  ridiculous(from, filter, language)
  shit(from, filter, language)
  even(from, filter, language)
  fewer(name, from, filter, language)
  ftfy(from, filter, language)
  holygrail(from, filter, language)
  idea(from, filter, language)
  jinglebells(from, filter, language)
  legend_(name, from, filter, language)
  logs(from, filter, language)
  ratsarse(from, filter, language)
  rockstar(name, from, filter, language)
  waste(name, from, filter, language)
  absolutely(name, from, filter, language)
  dense(from, filter, language)
  dumbledore(from, filter, language)
  lowpoly(from, filter, language)
  understand(name, from, filter, language)
  yeah(from, filter, language)
 
  getRandomFO(name, from, filter, language)

  version()
  operations()

  ## S3 method for class 'rfoaas'
print(x, width = NULL, ...)

Arguments

name

The name to whom the message is directed.

from

The name of the message requester. If omitted, the value of the (optional) global variable ‘rfoaasFrom’ is used, and if that variable is missing or unset, a default is filled-in based on the user name obtained via Sys.info.

filter

An optional filter. If unset, the (optional) global variable ‘rfoaasFilter’ can provide a default, and a fallback value of ‘none’. Currently the only other permitted value is ‘shoutcloud’ to enable filtering via the magnificient http://shoutcloud.io service.

language

An optional filter argument. If set, the message is internationalized to the given (optional) language stated as the the usual two-character code such as ‘fr’, ‘de’, ‘es’.

reference

An additional referenced in the message.

company

A company referenced in the message.

tool

A company referenced in the message.

do

A activity referenced in the message.

something

An object referenced in the message.

reaction

An activity referenced in the message.

x

Default object for print method

width

Optional column width parameter

...

Other optional arguments

Details

The operations() query returns a JSON object describing the current API. The version() function returns the current API version (as text). All other methods return the requested FOAAS message using the given arguments.

See http://foaas.com for complete service details at the current API level.

At present, only plain text requests are made and returned (with one exception being operations(), see above).

The from argument uses an internal helper function to supply a default value: either an R options() variable accessible via the key rfoaasFrom, or the value of Sys.info()["user"] as fallback.

The filter argument uses an internal helper function to supply a default value: either an R options() variable accessible via the key rfoaasFilter, or a default of ‘none’. Currently, the only other permissible value is ‘shoutcloud’ to enable filtering via the magnificient http://shoutcloud.io service.

Value

For all (but one) queries, a text string with the request FOAAS message is returned.

The exception is the very last query listed: operations() returns a JSON object describing all queries currently supported by the API, along with their (descriptive) name, the URL and the supported fields. As the return object is in JSON, one the available JSON parsers implementing a fromJSON() method is recommended to convert it into a native R object.

Return values are set to the UTF-8 encoding as the FOAAS service defaults using UTF-8 strings. Anectodatally, this seems to help only on the Windows operating system as the other already handled UTF-8 correctly.

Author(s)

Dirk Eddelbuettel

Examples

## Not run:                    # as we need a needwork connection

    ## returns current API version
    version()

    ## example 'madison' accessor in API
    madison("Billy", "Eric")

    ## operations() returns JSON object listing the accessible functionality
    if (require(jsonlite)) print(fromJSON(operations()))

    
## End(Not run)