Package 'rpinterest'

Title: Access Pinterest API
Description: Get information (boards, pins and users) from the Pinterest <http://www.pinterest.com> API.
Authors: Colin Fay [cre, aut]
Maintainer: Colin Fay <[email protected]>
License: MIT + file LICENSE
Version: 0.4.0
Built: 2024-11-03 03:54:23 UTC
Source: https://github.com/colinfay/rpinterest

Help Index


Create, delete, or edit a Board

Description

Create, delete, or edit a Board

Usage

create_board(name, description, token)

delete_board(board, token)

edit_board(board, name = NULL, description = NULL, token)

Arguments

name

name of the new board for creation, new name to give for edit.

description

description of the board?

token

a character string with an access token generated with 'pinterest_token()'

board

a board name.

Value

Either a data.frame, or an error.

Examples

## Not run: 
create_board("testboard", "from rpinterest", token)
delete_board("colinfay/testboard", token)
edit_board("colinfay/testboard",description = "A new desc", token = token)

## End(Not run)

Create, delete, or edit a Pin

Description

Create, delete, or edit a Pin

Usage

create_pin(file, board, note, link = NULL, token)

delete_pin(id, token)

edit_pin(id, board = NULL, note = NULL, link = NULL, token)

Arguments

file

the path to the file

board

name of the board (required)

note

a description (required)

link

an url (optional)

token

a character string with an access token generated with 'pinterest_token()'

id

a character string with an ID.

Value

Either a data.frame, or an error.

Examples

## Not run: 
create_pin("~/Pictures/graph.png", "my_board", "a graph", token = token)
delete_pin("42080577756375754", token)
edit_pin("42080577744990466",note = "run run run", token = token)

## End(Not run)

Retrieve the Pins on a Board

Description

Get information about all the pins on a pinterest board using the board ID or user/name.

Usage

get_board_pins_by_id(id, token)

get_board_pins_by_name(user, board, token)

Arguments

id

a character string with an ID.

token

a character string with an access token generated with 'pinterest_token()'

user

a character string with a user name.

board

a character string with a board name.

Value

Either a data.frame, or an error.

Examples

## Not run: 
get_board_pins_by_id(id = "42080646457333782", token = token)
get_board_pins_by_name(user = "colinfay", board = "violet-mon-amour", token = token)

## End(Not run)

Retrieve information about a Board

Description

Get information about a pinterest board using the board ID or the name/user combination.

Usage

get_board_spec_by_id(id, token)

get_board_spec_by_name(user, board, token)

Arguments

id

a character string with a board ID.

token

a character string with an access token generated with 'pinterest_token()'

user

a character string with a user name.

board

a character string with a board name.

Value

Either a data.frame, or an error.

Examples

## Not run: 
get_board_spec_by_id(id = "42080646457333782", token = token)
get_board_spec_by_name(user = "colinfay", board = "blanc-mon-amour", token = token)

## End(Not run)

Get Information about the logged user

Description

Get user information about their account or about their boards.

Usage

get_logged_user(token)

get_logged_user_boards(token)

get_logged_user_boards_suggestions(count = 25, token)

Arguments

token

a character string with an access token generated with 'pinterest_token()'

count

for suggestions, the max number of suggestion to retrieve.

Value

Either a data.frame, or an error.

Examples

## Not run: 
get_logged_user(token)
get_logged_user_boards(token)
get_logged_user_boards_suggestions(token = token)

## End(Not run)

Return information about a Pin

Description

Get information about a pinterest pin using the pin ID.

Usage

get_pin_spec_by_id(id, token)

Arguments

id

a character string with a pin ID.

token

a character string with an access token generated with 'pinterest_token()'

Value

Either a data.frame, or an error.

Examples

## Not run: 
get_pin_spec_by_id(id = "42080577745042298", token = token)

## End(Not run)

Return a user's information

Description

Get information about a Pinterest user using the ID or name.

Usage

get_user_spec_by_id(id, token)

get_user_spec_by_name(user, token)

Arguments

id

a character string with a user ID.

token

a character string with an access token generated with 'pinterest_token()'

user

a character string with a user name.

Value

Either a data.frame, or an error.

Examples

## Not run: 
get_user_spec_by_id(id = "42080715176677612", token = token)
get_user_spec_by_name(user = "colinfay", token = token)

## End(Not run)

Send a ggplot plot to a Pinterest board

Description

Send a ggplot plot to a Pinterest board

Usage

ggplot_to_pinterest(plot, board, note, link = NULL, token, ...)

Arguments

plot

a ggplot object

board

the name of the board

note

description of the image

link

a link to put under the image

token

a character string with an access token generated with 'pinterest_token()'

...

arguments to be passed to 'ggsave()'

Value

Either a data.frame, or an error.

Examples

## Not run: 
library(ggplot2)
x <- ggplot(iris, aes(Sepal.Length, Sepal.Width)) + geom_point()
ggplot_to_pinterest(x, "colinfay/gris-mon-amour", "test rpinterest", token = token)

## End(Not run)

Create a Pinterest API token

Description

Create a Pinterest API token

Usage

pinterest_token(app, app_id, app_secret, verbose = TRUE,
  callback = "https://colinfay.me/rpinterestcallback/")

Arguments

app

the name of your app

app_id

the ID of your app

app_secret

the secret of the app

verbose

wether of not to print a message about the auth process

callback

the callback uri for your app

Value

an access token