Skip to content

Commit

Permalink
add support for og:regdate (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
adbar committed Nov 14, 2023
1 parent 52705a3 commit 93530b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions htmldate/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def logstring(element: HtmlElement) -> str:
"og:publish_date",
"og:published_time",
"og:question:published_time",
"og:regdate",
"originalpublicationdate",
"parsely-pub-date",
"pdate",
Expand Down
7 changes: 7 additions & 0 deletions tests/unit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ def test_exact_date():
)
== "2017-09-01"
)
assert (
find_date(
'<html><head><meta property="og:regDate" content="20210820030646"></head><body></body></html>',
extensive_search=False,
)
== "2021-08-20"
)
assert (
find_date(
'<html><head><meta name="created" content="2017-01-09"/></head><body></body></html>'
Expand Down

0 comments on commit 93530b1

Please sign in to comment.