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.
Connections
Connections$new(keysPath)
Arguments:
keysPath: (character) path of the .ini file that contains the keys.
getTwitterToken: gets the Twitter token ID.
Usage:
getTwitterToken()
Value:
value of twitterToken
.
startConnectionWithTwitter: is responsible of establishing the connection to Twitter.
Usage:
startConnectionWithTwitter()
checkRequestToTwitter function in charge of handling the connection with Twitter.
Usage:
checkRequestToTwitter()
startConnectionWithYoutube function able to establish the connection with YouTube.
Usage:
startConnectionWithYoutube()
addNumRequestToYoutube function that increases in one the number of request to YouTube.
Usage:
addNumRequestToYoutube()
checkRequestToYoutube handles the connection with YouTube.
Usage:
checkRequestToYoutube()
getNumRequestMaxToYoutube gets the number of maximum requests allowed by YouTube API.
Usage:
getNumRequestMaxToYoutube()
Value: value of number maximun of request to YouTube.
keys: (list) the keys of Twitter and YouTube.
numRequestToYoutube: (numeric) indicates the number of requests made to YouTube.
numRequestMaxToYoutube: (numeric) indicates the maximum number of requests with YouTube.
connectionWithYoutube: (logical) indicates if the connection has been established with YouTube.
connectionWithTwitter: (logical) indicates if the connection has been established with Twitter.
twitterToken: (Token) token to establish the connection to Twitter.
The way to indicate the keys of YouTube and Twitter has to be through the configuration file that contains the following structure:
[twitter]
ConsumerKey = <<consumer_key>>
ConsumerSecret = <<consumer_secret>>
AccessToken = <<access_token>>
AccessTokenSecret = <<access_token_secret>>
[youtube]
app_id = <<app_id>>
app_password = <<app_password>>