Learn R Programming

bdpar (version 1.0.1)

ExtractorTwtid: Class to handle tweets files with twtid extension

Description

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

Usage

ExtractorTwtid

Arguments

Constructor

ExtractorTwtid$new(path)

  • Arguments:

    • path: (character) path of the twtid type file.

Inherit

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

Methods

  • 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()

Private fields

  • id: (character) ID of tweet.

Details

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>>

See Also

ExtractorEml, ExtractorSms, ExtractorYtbid, Instance,