Connections: Class to manage the connections with Twitter and YouTube

ConnectionsR Documentation

Class to manage the connections with Twitter and YouTube

Description

The tasks of the functions that the Connections class has are to establish the connections and control the number of requests that have been made with the APIs of Twitter and YouTube.

Details

The way to indicate the keys of YouTube and Twitter has to be through fields of bdpar.Options variable:

[twitter]

- bdpar.Options$set("twitter.consumer.key", <<consumer_key>>)

- bdpar.Options$set("twitter.consumer.secret", <<consumer_secret>>)

- bdpar.Options$set("twitter.access.token", <<access_token>>)

- bdpar.Options$set("twitter.access.token.secret", <<access_token_secret>>)

[youtube]

- bdpar.Options$set("youtube.app.id", <<app_id>>)

- bdpar.Options$set("youtube.app.password", <<app_password>>)

Note

Fields of unused connections will be automatically ignored by the platform.

Methods

Public methods


Method new()

Creates a Connections object.

Usage
Connections$new()

Method getTwitterToken()

Gets the Twitter token ID.

Usage
Connections$getTwitterToken()
Returns

Value of twitterToken.


Method startConnectionWithTwitter()

Responsible of establishing the connection to Twitter.

Usage
Connections$startConnectionWithTwitter()

Method checkRequestToTwitter()

Function in charge of handling the connection with Twitter.

Usage
Connections$checkRequestToTwitter()

Method startConnectionWithYoutube()

Function able to establish the connection with YouTube.

Usage
Connections$startConnectionWithYoutube()

Method addNumRequestToYoutube()

Function that increases in one the number of request to YouTube.

Usage
Connections$addNumRequestToYoutube()

Method checkRequestToYoutube()

Handles the connection with YouTube.

Usage
Connections$checkRequestToYoutube()

Method getNumRequestMaxToYoutube()

Gets the number of maximum requests allowed by YouTube API.

Usage
Connections$getNumRequestMaxToYoutube()
Returns

Value of number maximum of request to YouTube.


Method clone()

The objects of this class are cloneable with this method.

Usage
Connections$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

bdpar.Options, ExtractorTwtid, ExtractorYtbid


bdpar documentation built on Aug. 22, 2022, 5:08 p.m.