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

Presentations should be chronologically ordered #3

Closed
Mikejmnez opened this issue May 22, 2024 · 8 comments
Closed

Presentations should be chronologically ordered #3

Mikejmnez opened this issue May 22, 2024 · 8 comments
Assignees
Labels
invalid This doesn't seem right

Comments

@Mikejmnez
Copy link
Collaborator

Mikejmnez commented May 22, 2024

Brief description

Presentations from Zenodo look great! However, these are not arranged chronologically and that can cause some confusion.

Visual Aid

Screenshot 2024-05-22 at 11 10 24 AM

Page URL

  • HOMEPAGE/community/presentations/?zenodo_page=1
@Mikejmnez Mikejmnez changed the title Presentations should to be chronologically ordered Presentations should be chronologically ordered May 22, 2024
@Mikejmnez Mikejmnez added the invalid This doesn't seem right label May 23, 2024
@Mikejmnez
Copy link
Collaborator Author

The same issue shows up in the community page:

Screenshot 2024-05-23 at 8 36 18 AM

@Mikejmnez
Copy link
Collaborator Author

@jahattox I couldn't figure out how to do this on the site builder. Do you think this is possible to set up?

@jahattox
Copy link

@Mikejmnez I'm wondering if this is a limitation of the Zenodo API. Here's the docs: https://developers.zenodo.org/#list

And here's the API call the plugin uses: https://zenodo.org/api/records/?sort=mostrecent

Could it be that "mostrecent" means the most recently uploaded, rather than ordering by publication date? I tried reversing the sort as well, and it updates, but it still isn't ordered by the year.

@ndp-opendap
Copy link

Could it be that "mostrecent" means the most recently uploaded, rather than ordering by publication date? I tried reversing the sort as well, and it updates, but it still isn't ordered by the year.

That's what it means I think.

@Mikejmnez
Copy link
Collaborator Author

@Mikejmnez I'm wondering if this is a limitation of the Zenodo API. Here's the docs: https://developers.zenodo.org/#list

And here's the API call the plugin uses: https://zenodo.org/api/records/?sort=mostrecent

Could it be that "mostrecent" means the most recently uploaded, rather than ordering by publication date? I tried reversing the sort as well, and it updates, but it still isn't ordered by the year.

I see. Then perhaps the solution would be to (manually) modify these presentations (get a new version of the presentation that is) so that sorting these result in a chronological order arrangement...

@Mikejmnez
Copy link
Collaborator Author

Mikejmnez commented Jun 14, 2024

@jahattox I finally had some time to look into this. Zenodo has several ways of sorting the records, and one of them is Published[newest]. That is what we want (see here). By looking at the sorting key what we want is:

{'sort':'publication-desc'}

I quickly ran in a ipython shell and

community_id = 'opendap'
url = f'https://zenodo.org/api/records'
params = {
    'communities': community_id,
    'page': 1,
    'sort': 'publication-desc',
    'size': 10  # Number of records per page (maximum is 100)
}
response = requests.get(url, params=params)
data = response.json()

and looking at the data, something like this should work...

@jahattox
Copy link

@Mikejmnez Nice! That seems to have done the trick. I just pushed up the change. How do things look on your end?

@Mikejmnez
Copy link
Collaborator Author

Mikejmnez commented Jun 17, 2024

@jahattox they look great! marking this as completed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants