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 = {}) ⇒ Hash

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:

  • (Hash)

    New twitter query



47
48
49
# File 'lib/bwapi/client/projects/twitter_queries.rb', line 47

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

#delete_twitter_query(project_id, query_id) ⇒ Object

Delete a Twitter query

TODO: Add parameters documentation



83
84
85
# File 'lib/bwapi/client/projects/twitter_queries.rb', line 83

def delete_twitter_query(project_id, query_id)
  delete "/projects/#{project_id}/twitterqueries/#{query_id}"
end

#get_twitter_query(project_id, query_id) ⇒ Hash

Get a specific twitter query in a project

Parameters:

  • project_id (Integer)

    Id of project

  • query_id (Integer)

    Id of twitter query

Returns:

  • (Hash)

    Specific twitter query



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

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

#twitter_queries(project_id) ⇒ Hash

Get all twitter queries in a project

Parameters:

  • project_id (Integer)

    Id of project

Returns:

  • (Hash)

    All twitter queries in project



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

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

#update_twitter_query(project_id, query_id, opts = {}) ⇒ Hash

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:

  • (Hash)

    Updated twitter query



76
77
78
# File 'lib/bwapi/client/projects/twitter_queries.rb', line 76

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