mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-25 17:16:00 +03:00
[PR #493] [MERGED] Feature: add og:title metadata as alternative title #4206
Labels
No labels
expected: maybe someday
expected: next release
expected: release after next
expected: unlikely unless contributed
good first ticket
help wanted
pull-request
scope: all users
scope: windows users
size: easy
size: hard
size: medium
size: medium
status: backlog
status: blocked
status: done
status: idea-phase
status: needs followup
status: wip
status: wontfix
touches: API/CLI/Spec
touches: configuration
touches: data/schema/architecture
touches: dependencies/packaging
touches: docs
touches: js
touches: views/replayers/html/css
why: correctness
why: functionality
why: performance
why: security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ArchiveBox#4206
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ArchiveBox/ArchiveBox/pull/493
Author: @ttimasdf
Created: 9/27/2020
Status: ✅ Merged
Merged: 10/30/2020
Merged by: @pirate
Base:
master← Head:feat-ogtitle📝 Commits (1)
eda3836feat: add og:title metadata as alternative title📊 Changes
1 file changed (+30 additions, -7 deletions)
View changed files
📝
archivebox/extractors/title.py(+30 -7)📄 Description
Summary
Open Graph Tags is a mechanism for a website to provide metadata when an URL is shared through social media. I encountered some rare cases that the webpage's
<title>tag is set through Javascript dynamically at page load, but anog:titlemetadata is present.This PR make use of open graph tags as a fallback for grabbing page title (also has the potential to gather other metadatas). It extend the
titleextractor withHTMLParser, not breaking any existing behaviour. The<title>tag content is still the highest priority.I did not extend the existing regex expression because the HTML is complicated and contains many special cases that cannot be handled easily by regex. In examples below, two attributes in
<meta>is in different order and only the second one has<xxx />form. I didn't even try to parse it through regex. 💫examples:
link2: Blogspot
link1: WeChat Platform ,
Changes these areas
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.