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