Permalink
Browse files

Updated history and refactored trends a bit.

  • Loading branch information...
jnunemaker committed May 18, 2009
1 parent 7fe1f77 commit beeb2e798a9f9513c37f78c580a82aafb70acf3d
Showing with 16 additions and 6 deletions.
  1. +4 −0 History
  2. +12 −6 lib/twitter/trends.rb
View
@@ -1,3 +1,7 @@
+0.6.10 - May 18, 2009
+* 1 cool addition
+ * Added full support for trends - current, daily and weekly (even allowing excluding of hashtags and for specific dates)
+
0.6.9 - May 17, 2009
* 1 minor tweak
* Bumped oauth dependency version to 0.3.4.
View
@@ -6,18 +6,24 @@ class Trends
# :exclude => 'hashtags' to exclude hashtags
def self.current(options={})
- response = get('/current.json', :query => options)
- response['trends'].values.flatten.map { |t| Mash.new(t) }
+ mashup(get('/current.json', :query => options))
end
+ # :exclude => 'hashtags' to exclude hashtags
+ # :date => yyyy-mm-dd for specific date
def self.daily(options={})
- response = get('/daily.json', :query => options)
- response['trends'].values.flatten.map { |t| Mash.new(t) }
+ mashup(get('/daily.json', :query => options))
end
+ # :exclude => 'hashtags' to exclude hashtags
+ # :date => yyyy-mm-dd for specific date
def self.weekly(options={})
- response = get('/weekly.json', :query => options)
- response['trends'].values.flatten.map { |t| Mash.new(t) }
+ mashup(get('/weekly.json', :query => options))
end
+
+ private
+ def self.mashup(response)
+ response['trends'].values.flatten.map { |t| Mash.new(t) }
+ end
end
end

0 comments on commit beeb2e7

Please sign in to comment.