Learn R Programming

bdpar (version 3.1.0)

ExtractorYtbid: Class to handle comments of YouTube files with ytbid extension

Description

This class inherits from the Instance class and implements the functions of extracting the text and the date of an ytbid type file.

Arguments

Inherit

This class inherits from Instance and implements the obtainSource and obtainDate abstracts functions.

Super class

bdpar::Instance -> ExtractorYtbid

Methods

Inherited methods


Method new()

Creates a ExtractorYtbid object.

Usage

ExtractorYtbid$new(path, cachePath = NULL)

Arguments

path

A character value. Path of the ytbid file.

cachePath

A character value. Path of the cache location. If it is NULL, checks if is defined in the "cache.youtube.path" field of bdpar.Options variable.


Method obtainId()

Obtains the ID of the specific Youtube's comment. Reads the ID of the file indicated in the variable path.

Usage

ExtractorYtbid$obtainId()


Method getId()

Gets the ID of an specific Youtube's comment.

Usage

ExtractorYtbid$getId()

Returns

Value of Youtube's comment ID.


Method 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

ExtractorYtbid$obtainDate()


Method 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

ExtractorYtbid$obtainSource()


Method toString()

Returns a character representing the instance

Usage

ExtractorYtbid$toString()

Returns

Instance character representation


Method clone()

The objects of this class are cloneable with this method.

Usage

ExtractorYtbid$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

YouTube connection is handled through the Connections class which loads the YouTube API credentials from the bdpar.Options object. 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 "cache.youtube.path" field of bdpar.Options variable. This variable has to be the path to store the comments and it is necessary that it has two folder named: "_spam_" and "_ham_"

See Also

bdpar.Options, Connections, ExtractorEml, ExtractorSms, Instance