Module: BCG
- Defined in:
- lib/byul.rb
Class Method Summary collapse
- .all_tags_with_counts ⇒ Object
- .all_with_tag(q) ⇒ Object
- .current ⇒ Object
- .daily ⇒ Object
- .most_tagged_with(q) ⇒ Object
- .search(q = nil) ⇒ Object
- .top_25_tags ⇒ Object
- .weekly ⇒ Object
Class Method Details
.all_tags_with_counts ⇒ Object
37 38 39 |
# File 'lib/byul.rb', line 37 def self.() Document. end |
.all_with_tag(q) ⇒ Object
33 34 35 |
# File 'lib/byul.rb', line 33 def self.all_with_tag(q) Document.all_with_tag(q) end |
.current ⇒ Object
15 16 17 18 19 |
# File 'lib/byul.rb', line 15 def self.current Twitter::Trends.current.each do |c| BCG.search(c) end end |
.daily ⇒ Object
27 28 29 30 31 |
# File 'lib/byul.rb', line 27 def self.daily Twitter::Trends.daily.each do |d| BCG.search(d) end end |
.most_tagged_with(q) ⇒ Object
41 42 43 |
# File 'lib/byul.rb', line 41 def self.most_tagged_with(q) Document.most_tagged_with(q) end |
.search(q = nil) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/byul.rb', line 49 def self.search(q=nil) if q begin res = Twitter::Search.new(q.query) res.each do |s| t = Document.new(:twit_id => s.id, :from_user => s.from_user, :from_user_id => s.from_user_id, :profile_image_url => s.profile_image_url, :text => s.text, :source => s.source, :to_user_id => s.to_user_id) t.tag(q.name, t) t.save end rescue Exception => e puts e end end end |
.top_25_tags ⇒ Object
45 46 47 |
# File 'lib/byul.rb', line 45 def self. Document. end |