Module: BWAPI::Client::Projects::TwitterQueries

Included in:
BWAPI::Client::Projects
Defined in:
lib/bwapi/client/projects/twitter_queries.rb

Overview

TwitterQueries module for projects/twitterqueries endpoints

Instance Method Summary collapse

Instance Method Details

#create_twitter_query(project_id, opts = {}) ⇒ Hashie::Mash

Create a twitter query in a project

Parameters:

  • project_id (Integer) —

    Id of project

  • opts (Hash) (defaults to: {}) —

    options hash of parameters

Options Hash (opts):

  • id (Integer) —

    Id of the query

  • name (String) —

    Name of the query

  • authorised (Boolean) —

    Is query authorised

  • averageMonthlyMentions (Integer) —

    Average monthly mentions

  • contextTerms (Array) —

    Content terms of the query

  • excludedTerms (Array) —

    Excluded terms of thequery

  • includedTerms (Array) —

    Included terms of terms query

  • creationDate (Date) —

    Date the query was created on

  • dailyLimit (Integer) —

    Daily limit of the query

  • facebookCrawlComplete (Boolean) —

    Facebook initial crawling status

  • facebookPageId (Integer) —

    Id of the facebook page

  • facebookPageName (String) —

    Name of the facebook page

  • failed (Boolean) —

    Triggered too many Facebook API request failures

  • industry (String) —

    Industry of the query

  • languages (Array) —

    Query languages set

  • lastModificationDate (Date) —

    Last modification date of the query

  • type (String) —

    Query type

  • twitterLimit (String) —

    Twitter limit

  • twitterScreenName (String) —

    Twitter screen name

Returns:

  • (Hashie::Mash) —

    New twitter query



49
50
51
# File 'lib/bwapi/client/projects/twitter_queries.rb', line 49

def create_twitter_query project_id, opts={}
  post "projects/#{project_id}/twitterqueries", opts
end

#get_twitter_query(project_id, query_id) ⇒ Hashie::Mash Also known as: twitter_query

Get a specific twitter query in a project

Parameters:

  • project_id (Integer) —

    Id of project

  • query_id (Integer) —

    Id of twitter query

Returns:

  • (Hashie::Mash) —

    Specific twitter query



20
21
22
# File 'lib/bwapi/client/projects/twitter_queries.rb', line 20

def get_twitter_query project_id, query_id
  get "projects/#{project_id}/twitterqueries/#{query_id}"
end

#twitter_queries(project_id) ⇒ Hashie::Mash

Get all twitter queries in a project

Parameters:

  • project_id (Integer) —

    Id of project

Returns:

  • (Hashie::Mash) —

    All twitter queries in project



11
12
13
# File 'lib/bwapi/client/projects/twitter_queries.rb', line 11

def twitter_queries project_id
  get "projects/#{project_id}/twitterqueries"
end

#update_twitter_query(project_id, query_id, opts = {}) ⇒ Hashie::Mash

Update an existing twitter query in a project

Parameters:

  • project_id (Integer) —

    Id of project

  • query_id (Integer) —

    Id of query

  • opts (Hash) (defaults to: {}) —

    options hash of parameters

Options Hash (opts):

  • id (Integer) —

    Id of the query

  • name (String) —

    Name of the query

  • authorised (Boolean) —

    Is query authorised

  • averageMonthlyMentions (Integer) —

    Average monthly mentions

  • contextTerms (Array) —

    Content terms of the query

  • excludedTerms (Array) —

    Excluded terms of thequery

  • includedTerms (Array) —

    Included terms of terms query

  • creationDate (Date) —

    Date the query was created on

  • dailyLimit (Integer) —

    Daily limit of the query

  • facebookCrawlComplete (Boolean) —

    Facebook initial crawling status

  • facebookPageId (Integer) —

    Id of the facebook page

  • facebookPageName (String) —

    Name of the facebook page

  • failed (Boolean) —

    Triggered too many Facebook API request failures

  • industry (String) —

    Industry of the query

  • languages (Array) —

    Query languages set

  • lastModificationDate (Date) —

    Last modification date of the query

  • type (String) —

    Query type

  • twitterLimit (String) —

    Twitter limit

  • twitterScreenName (String) —

    Twitter screen name

Returns:

  • (Hashie::Mash) —

    Updated twitter query



78
79
80
# File 'lib/bwapi/client/projects/twitter_queries.rb', line 78

def update_twitter_query project_id, query_id, opts={}
  put "projects/#{project_id}/twitterqueries/#{query_id}", opts
end