philnash / bitly

🗜 A Ruby wrapper for the bit.ly API
https://rubygems.org/gems/bitly
MIT License
451 stars 139 forks source link

While fetching the referrers using Bitly::V3::User i am getting only today's data..How can i get the last 30 day's referrers #28

Closed metripurari closed 11 years ago

metripurari commented 12 years ago

I am using bitly gem to access the bitly api. While fetching the referrers using Bitly::V3::User i am getting only today's data..How can i get the last 30 day's referrers. My code is here.

o = Bitly::V3::OAuth.new(configatron.bitly.client_id, configatron.bitly.client_secret)
@access_token = o.get_access_token_from_code(params[:code], configatron.bitly.redirect_url)
u=Bitly::V3::User.new(o.access_token)
@a = u.link_history
@r = u.referrers
philnash commented 11 years ago

You'll need to pass parameters to the call to get the time period you are after. See the documentation on Bitly's Developer site for the parameters you'll need: http://dev.bitly.com/user_metrics.html#v3_user_referrers