Skip to content
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

statistics view #9

Open
kosarko opened this issue Nov 13, 2024 · 0 comments
Open

statistics view #9

kosarko opened this issue Nov 13, 2024 · 0 comments
Assignees

Comments

@kosarko
Copy link
Member

kosarko commented Nov 13, 2024

v5 displays custom statistics (item views, total and individual bitstream download counts) per item, with drill down from all time -> individual year -> individual month.

The current (v5) implementation is in https://github.com/ufal/piwik-charts and has a live demo at https://ufal.github.io/piwik-charts/ (https://ufal.github.io/piwik-charts/single-chart-example.html or https://ufal.github.io/piwik-charts/multi-chart-example.html)

The examples reveal most of the api. The endpoint is https://lindat.mff.cuni.cz/statistics/handle?h=<item_handle>&period=[year|month|day]&date=[yyyy|yyyy-MM]

  • h is the handle of an item, you get that from metadata field dc.identifier.uri, it's only ther prefix/suffix part (ie. you need to strip http(s)://hdl.handle.net/ if present. This parameter is mandatory
  • date - if missing it returns the overall + year based counts; if it is in the yyyy form (e.g. 2020), it returns totals for the given year and a breakdown into individual months; if in the yyyy-MM (e.g. 2020-10) it returns total for the given month + a breakdown into individual dates. It handles the month with and without the leading zero (02 and 2)
  • period can be ignored (it's determinated by the date)

The implementation at https://github.com/ufal/piwik-charts/blob/master/js/piwik_charts.js does some sort of caching (if you zoom in a level and then, zoom out...). If it's a recent item such as 11234/1-5502 which has data only for the current year, it zooms in automatically ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants