Module: BWAPI::Client::Projects::FacebookQueries

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

Overview

FacebookQueries module for projects/facebookqueries endpoints

Instance Method Summary collapse

Instance Method Details

#authorise_facebook_queries(project_id, opts = {}) ⇒ Hash

Authorise facebook queries in a project

Parameters:

  • project_id (Integer)

    Id of project

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

    options hash of facebook query oauth dto

Options Hash (opts):

  • accessToken (String)

    Facebook access token

  • consumerKey (String)

    Facebook consumer key

  • queryIds (Array)

    Array of query ids

Returns:

  • (Hash)

    Authorised facebook queries



59
60
61
# File 'lib/bwapi/client/projects/facebook_queries.rb', line 59

def authorise_facebook_queries(project_id, opts = {})
  post "projects/#{project_id}/facebookqueries/authorise", opts
end

#create_facebook_query(project_id, opts = {}) ⇒ Hash

Create a facebook 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

  • facebookConsumerKey (String)

    Facebook consumer key

  • facebookAccessToken (String)

    Facebook access token

Returns:

  • (Hash)

    New facebook query



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

def create_facebook_query(project_id, opts = {})
  post "projects/#{project_id}/facebookqueries", opts
end

#delete_facebook_query(project_id, query_id) ⇒ Object

Delete a Facebook query

TODO: Add parameters documentation



95
96
97
# File 'lib/bwapi/client/projects/facebook_queries.rb', line 95

def delete_facebook_query(project_id, query_id)
  delete "/projects/#{project_id}/facebookqueries/#{query_id}"
end

#facebook_queries(project_id) ⇒ Hash

Get all facebook queries in a project

Parameters:

  • project_id (Integer)

    Id of project

Returns:

  • (Hash)

    All facebook queries in project



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

def facebook_queries(project_id)
  get "projects/#{project_id}/facebookqueries"
end

#get_facebook_query(project_id, query_id) ⇒ Hash

Get a specific facebook query in a project

Parameters:

  • project_id (Integer)

    Id of project

  • query_id (Integer)

    Id of facebook query

Returns:

  • (Hash)

    Specific facebook query



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

def get_facebook_query(project_id, query_id)
  get "projects/#{project_id}/facebookqueries/#{query_id}"
end

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

Update an existing facebook 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

  • facebookConsumerKey (String)

    Facebook consumer key

  • facebookAccessToken (String)

    Facebook access token

Returns:

  • (Hash)

    Updated facebook query



88
89
90
# File 'lib/bwapi/client/projects/facebook_queries.rb', line 88

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