-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add weekly citations report #6238
Comments
It would be useful to have this feature to allow us to see what requests have received 'in the news' citations to more easily identify good use of the service Sally |
range = (Time.now.beginning_of_week-1.week)..Time.now.beginning_of_week
def pro_citation?(citation)
return true if citation.citable.is_a?(InfoRequestBatch)
pro_account = citation.citable.user.pro_account
return false unless pro_account
subscriptions = Stripe::Subscription.list(
status: 'all', customer: pro_account.stripe_customer_id
)
ranges = subscriptions.map do |s|
started_at = Time.at(s.created)
ended_at = Time.at(s.ended_at) if s.ended_at
ended_at ||= Time.now
started_at..ended_at
end
ranges.any? { |r| r.include?(citation.created_at) }
end
Citation.where(created_at: range).uniq.map do |c|
pro = pro_citation?(c) ? 'PRO: ' : 'NOT-PRO: '
puts pro + "https://www.whatdotheyknow.com/request/" + c.citable.url_title
end |
It might be worth looking at who is adding the citations - to look to see if requesters are being effectively encouraged to add their own, and to surface some potentially more hidden work done by volunteers. Related: #6620 Public credit for individuals who added "in the news" links |
Noting an updated version of the export script at https://github.com/mysociety/alaveteli/wiki/Export-citations. |
This issue has been automatically closed due to a lack of discussion or resolution for over 12 months. |
We currently run some code in the console to have a look at the latest citations.
It would be good to create a periodic digest email to the admin addresses to see what gets mentioned.
We're currently interested in:
pro
at the time of making the requestThe text was updated successfully, but these errors were encountered: