Repository navigation
Show page one of each paper's PDF on X roundup and paper cards - #1159
Merged
Merged
Conversation
The weekly and monthly roundups now carry one 1600x2400 card per arXiv paper (up to four, X's limit): page one of the PDF from the title to the introduction on a branded sheet, numbered as in the post, with the TL;DR as a why-read-it line. Candidates gain extra_images, which `list` prints as extra_images_png_base64. A new `card` command renders the same card for single-paper posts so the X agent can use it instead of a page screenshot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A queued post can go out hours later, when the rank has moved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
compose_list can drop entries to fit 280 characters, so the card counter now counts only the papers the post lists. A PDF with no pages or any MuPDF error now skips that card instead of failing the whole list run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8e13b20. Configure here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

What
X posts about papers get a 2:3 card (1600×2400) showing page one of the real PDF in a Papers with Code frame, like multi-image paper threads on X.
top_papers_week/top_papers_month): one card per arXiv paper, up to 4 (X's per-post limit). Each card is numbered as in the post text (02 / 05), shows page one from the title down to the Introduction, and puts the TL;DR in a "Why read it" line. External papers are skipped. A paper whose PDF can't be fetched or read is left out. With no cards at all, the post falls back to the existing list card.pwc-cron x_post_candidates card --paper-id ID… [--rank N…]prints{"cards": {id: base64 PNG | null}}. This lets the host X agent use the card in place of a page screenshot fortrending_paperand "Tweet it" posts. It is a separate command solistdoesn't download 24 PDFs on every run, and the host caches each card.listoutput gainsextra_images_png_base64(a list).image_png_base64keeps holding the first image, so the current host keeps working unchanged.Crop: page one from the top of the text down to the "Introduction" heading. A short crop runs on into the page up to the sheet's aspect ratio and fades out. Margin notes, footnotes and page numbers are ignored.
Validation
pytest backend/tests/test_x_post_candidates.py backend/tests/test_x_insight_post_service.py: 62 passed (new tests: card numbering and skipping, the 4-card cap, a bad PDF, the split "1 / Introduction" heading).Host follow-up (not in this repo)
/root/x-post-schedule/post_x.pyuploads the extra images with the post and fetches cachedcardimages for paper posts. The dashboard shows the extra images.🤖 Generated with Claude Code
Note
Medium Risk
Roundup gathering now fetches and parses arXiv PDFs over the network (with fallbacks), which adds load and failure modes to the X candidate pipeline but stays scoped to the posting agent.
Overview
Adds 2:3 (1600×2400) branded image cards built from arXiv PDF page one (cropped title through Introduction, with a "Why read it" summary) for X posts about papers.
Weekly/monthly roundup candidates now attach up to four page-one cards—numbered like the post text—with
image_png_base64as the first card andextra_images_png_base64for the rest; failed or non-arXiv papers are skipped, and the post falls back to the existing list chart when no cards are produced.top_papersfacts gainpaper_ids(and related metadata) aligned with how many papers actually fit in the tweet.A new read-only CLI subcommand
pwc-cron x_post_candidates card --paper-id …returns per-paper base64 PNGs on demand solistdoes not download many PDFs every run. Rendering lives inrender_paper_page_card/roundup_page_cardswith new tests for caps, numbering, and bad PDFs.Reviewed by Cursor Bugbot for commit 10e39b7. Bugbot is set up for automated code reviews on this repo. Configure here.