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 = {}) ⇒ Hashie::Mash

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:

  • (Hashie::Mash) —

    Authorised facebook queries



61
62
63
# File 'lib/bwapi/client/projects/facebook_queries.rb', line 61

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

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

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:

  • (Hashie::Mash) —

    New facebook query



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

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

#facebook_queries(project_id) ⇒ Hashie::Mash

Get all facebook queries in a project

Parameters:

  • project_id (Integer) —

    Id of project

Returns:

  • (Hashie::Mash) —

    All facebook queries in project



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

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

#get_facebook_query(project_id, query_id) ⇒ Hashie::Mash Also known as: facebook_query

Get a specific facebook query in a project

Parameters:

  • project_id (Integer) —

    Id of project

  • query_id (Integer) —

    Id of facebook query

Returns:

  • (Hashie::Mash) —

    Specific facebook query



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

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

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

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:

  • (Hashie::Mash) —

    Updated facebook query



90
91
92
# File 'lib/bwapi/client/projects/facebook_queries.rb', line 90

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