get_pinterest: Retrieves the number of pins on Pinterest

Description Usage Arguments Value Author(s) References Examples

View source: R/get_pinterest.R

Description

Takes a URL and returns a data frame with the original URL and the number of pins on Pinterest. The function accepts the optional variable sleep.time (default=0) to avoid hitting API limits (if implemented). Use sleep.time to define the number of seconds the function will wait before proceeding to the next URL. If the URLs are shortened, you will have to first resolve them using the function get_url().

Usage

1
get_pinterest(links, sleep.time = 0)

Arguments

links

URL to be tracked on Pinterest

sleep.time

Number of seconds the function will wait before proceeding to the next URL

Value

Returns the original URL and the number of pins on Pinterest.

Author(s)

Marco Bastos

References

Pinterest is yet to release its official public API. More informatio at <https://developers.pinterest.com/>

Examples

1
get_pinterest("http://www.nytimes.com/")

Example output

Error in function (type, msg, asError = TRUE)  : 
  Could not resolve host: api.pinterest.com
Error : lexical error: invalid char in json text.
                                       Error in function (type, msg, a
                     (right here) ------^

[1] "Error : lexical error: invalid char in json text.\n                                       Error in function (type, msg, a\n                     (right here) ------^\n\n"
attr(,"class")
[1] "try-error"
attr(,"condition")
<simpleError: lexical error: invalid char in json text.
                                       Error in function (type, msg, a
                     (right here) ------^
>

SocialMediaMineR documentation built on May 29, 2017, 11:44 p.m.