Module: GovKit::ActsAsNoteworthy::InstanceMethods

Defined in:
lib/gov_kit/acts_as_noteworthy.rb

Overview

A module that adds methods to individual instances of the noteworthy class.

Instance Method Summary collapse

Instance Method Details

#raw_mentionsHash

Generates the raw mentions to be loaded into the Mention objects

Returns:

  • (Hash)

    a hash of all the mentions found of the object in question.



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/gov_kit/acts_as_noteworthy.rb', line 42

def raw_mentions
  opts = self.options.clone
  attributes = opts.delete(:with)

  if opts[:geo]
    opts[:geo] = self.instance_eval("#{opts[:geo]}")
  end

  query = []
  attributes.each do |attr|
    query << self.instance_eval("#{attr}")
  end

  {
    :google_news => GovKit::SearchEngines::GoogleNews.search(query, opts),
    :google_blogs => GovKit::SearchEngines::GoogleBlog.search(query, opts),
#        :technorati => GovKit::SearchEngines::Technorati.search(query),
    :bing => GovKit::SearchEngines::Bing.search(query, opts)
  }
end