This class inherits from the Instance
class and
implements the functions of extracting the text and the date of an ytbid type file.
ExtractorYtbid
ExtractorYtbid$new(path)
Arguments:
path: (character) path of the ytbid type file.
This class inherits from Instance
and implements the
obtainSource
and obtainDate
abstracts functions.
obtainId: obtains the id of the ytbid. Read the id of the file indicated in the variable path.
Usage:
obtainId()
getId: gets of comment ID.
Usage:
getId()
Value: value of comment ID.
obtainDate: obtains the date from a specific comment ID. If the comment has been previously cached the comment date is loaded from cache path. Otherwise, the request is perfomed using YouTube API and the date is then formatted to the established standard.
Usage:
obtainDate()
obtainSource: obtains the source from a specific comment ID. If the comment has previously been cached the source is loaded from cache path. Otherwise, the request is performed using on YouTube API.
Usage:
obtainSource()
id: (character) ID of comment.
YouTube conection is handled through the Connections
class
which loads the YouTube API credentials from the configuration file.
Additionally, to increase the processing speed, each youtube query is stored
in a cache to avoid the execution of duplicated queries. To enable this option,
cache location should be in the cachePathYtbid indicated in the
cache section from the configuration file. This variable has to be the
path to store the comments and it is neccesary that it has two folder named:
"_spam_" and "_ham_"
[cache]
cachePathYtbid = <<cache_path_ytbid>>