feat: add article parsing and handling to timeline and scraper modules#146
Open
LiamVDB1 wants to merge 7 commits intothe-convocation:mainfrom
Open
feat: add article parsing and handling to timeline and scraper modules#146LiamVDB1 wants to merge 7 commits intothe-convocation:mainfrom
LiamVDB1 wants to merge 7 commits intothe-convocation:mainfrom
Conversation
…on not available), only parse Article from `TweetDetail` endpoint.
karashiiro
requested changes
Jul 21, 2025
Collaborator
There was a problem hiding this comment.
Sorry it took so long for me to get around to this - could you add one or two basic tests to tweets.test.ts to validate that article parsing works at a basic level? It should be enough to just find a couple tweets with articles and check that the output is what we should expect it to be.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for handling articles within the timeline data structure. It includes changes to add new interfaces for articles, parse article data into markdown, and integrate articles into existing tweet parsing functionality.
Article Support Enhancements:
New Interfaces for Articles:
ArticleRaw,ArticleResultRaw,ArticleContentStateRaw, and related interfaces to represent article data, including metadata, media, and content state. (src/timeline-v1.ts, src/timeline-v1.tsR122-R194)SearchResultRawandTimelineResultRawto include an optionalarticlefield for article data. (src/timeline-v1.ts, [1] [2]Article Parsing Logic:
parseArticleToMarkdownto convert article content into markdown format, handling text, links, styles, headers, lists, and media. (src/timeline-v2.ts, src/timeline-v2.tsR261-R393)parseArticlefunction to map raw article data to the newArticleinterface, including extracting cover media details. (src/timeline-v2.ts, src/timeline-v2.tsR261-R393)Integration with Timeline Parsing:
parseResultto detect and process articles within timeline results, converting them to markdown and integrating them into theTweetstructure. (src/timeline-v2.ts, src/timeline-v2.tsR419-R425)Tweet Interface Updates:
Tweetinterface to includeisArticleandarticlefields, enabling tweets to reference associated article data. (src/tweets.ts, src/tweets.tsR79-R80)Articleinterface to define the structure of article data within tweets. (src/tweets.ts, src/tweets.tsR40-R46)