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

New translator for LinkedIn post pages. #3373

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

mamamusings
Copy link

This translator will retrieve all relevant metadata and a snapshot from LinkedIn individual post pages. It will only work when not logged into LinkedIn, because the page structure is entirely different when viewed by a logged-in user. It will work properly in incognito/private windows.

// NOTE: This translator will only work if you are *not* logged into LinkedIn. Logged-in versions of the page do not include the necessary metadata. If you are logged into LinkedIn, you can open a private or incognito window to use the translator. //

function detectWeb(doc, url) {
if (url.includes('/posts/')) {
Copy link
Member

Choose a reason for hiding this comment

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

If scrape() only works when script[type="application/ld+json"] exists, we should check that here.

Copy link
Author

Choose a reason for hiding this comment

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

added

LinkedIn.js Outdated Show resolved Hide resolved
LinkedIn.js Show resolved Hide resolved
LinkedIn.js Outdated Show resolved Hide resolved
}

newItem.forumTitle = "LinkedIn";
newItem.postType = "LinkedIn Post";
Copy link
Member

Choose a reason for hiding this comment

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

I don't know if we really need this - it's a forumPost on forumTitle "LinkedIn".


newItem.forumTitle = "LinkedIn";
newItem.postType = "LinkedIn Post";
newItem.websiteType = "Social Media";
Copy link
Member

Choose a reason for hiding this comment

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

Ditto - I don't think this is necessary for a citation.

Copy link
Author

Choose a reason for hiding this comment

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

I wasn't sure about this. LinkedIn posts are in kind of a gray area between forum posts and blog posts.

LinkedIn.js Outdated Show resolved Hide resolved
LinkedIn.js Outdated Show resolved Hide resolved
@AbeJellinek
Copy link
Member

Thanks! Some comments above.

mamamusings and others added 5 commits October 23, 2024 13:29
Accepted suggestion for modifying URL

Co-authored-by: Abe Jellinek <[email protected]>
modified code style

Co-authored-by: Abe Jellinek <[email protected]>
accepted change to push action

Co-authored-by: Abe Jellinek <[email protected]>
Co-authored-by: Abe Jellinek <[email protected]>
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