Skip to content

Add habr translator #3428

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

Merged
merged 2 commits into from
May 20, 2025
Merged

Add habr translator #3428

merged 2 commits into from
May 20, 2025

Conversation

puzan
Copy link
Contributor

@puzan puzan commented Mar 8, 2025

Add translator for habr.com

Based on Embedded Metadata. Updated fields:

  • websiteType
  • blogTitle
  • date
  • creators

Habr.js Outdated
const date = attr(doc, 'meta[property="aiturec:datetime"]', 'content');
item.date = ZU.strToISO(date);

const author = text(doc, 'div.tm-article-presenter__header span.tm-article-snippet__author a.tm-user-info__username');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Way, way too specific. Can we at least remove the tag names? Is .tm-user-info__username by itself not enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.tm-user-info__username is used too many times on page. Specially in comments block. I simplified css selector to .tm-article-presenter__header a.tm-user-info__username (userlink inside header).

@puzan puzan requested a review from AbeJellinek March 29, 2025 18:34
@AbeJellinek AbeJellinek merged commit b4a6852 into zotero:master May 20, 2025
1 check passed
@AbeJellinek
Copy link
Member

Thank you!

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

Successfully merging this pull request may close these issues.

2 participants