-
-
Notifications
You must be signed in to change notification settings - Fork 1
✨ feat(api): add support for article previews in scraping and storage #64
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
Conversation
- Introduce `add_article_preview` parameter to `get_articles`, `get_all_articles`, and `_parse_article_data` methods to optionally extract and include article preview text. - Update `save_to_sqlite` function to handle the new preview field in database schema and inserts, improving data completeness for users.
Summary of ChangesHello @chriskyfung, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Instapaper scraper by providing an optional mechanism to extract and persist article preview text. This addition allows users to gather more comprehensive data for each article, improving the utility of the scraped information without altering the default behavior for existing users. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively adds support for scraping and storing article previews. The changes are well-structured, touching the API, CLI, and output modules, and include corresponding updates to the tests. The new feature is also well-documented in docstrings and CLI help messages. I've found a couple of minor opportunities for improvement regarding code consistency and clarity, which I've detailed in the comments below.
This commit updates the documentation files to reflect the new feature. - Updates GEMINI.md to mention the new CLI option and output field. - Updates README.md to include the new command-line argument and updated output examples.
- Use KEY_ARTICLE_PREVIEW constant in api.py for better maintainability - Remove add_article_preview parameter from save_to_json, always including previews - Ensures article previews are consistently handled in scraped data output
Introduces new tests to `tests/test_output.py` to enhance robustness and cover edge cases in the output functionalities. This includes tests for: - Saving to SQLite with `instapaper_url` to verify content. - Saving to JSON with `instapaper_url` to ensure correct data transformation and non-mutation of original data. - Verifying the creation of necessary output directories by `save_articles`. - Handling `IOError` during article saving operations. - Gracefully managing articles with missing 'id' when `instapaper_url` is requested. - Detecting and handling malformed article data (non-dictionary items).
- Changed assertions in test_get_sqlite_create_table_sql_with_url_old_sqlite and test_get_sqlite_insert_sql_without_manual_url to compare against full expected SQL strings instead of partial substring checks, ensuring stricter validation. - Added a blank line after test_save_articles_corrects_extension for better readability.
This adjustment relaxes the code coverage requirement, allowing for more flexibility in patch-level coverage while maintaining a 2% threshold. This can help reduce CI failures for minor uncovered lines in pull requests.
add_article_previewparameter toget_articles,get_all_articles, and_parse_article_datamethods to optionally extract and include article preview text.save_to_sqlitefunction to handle the new preview field in database schema and inserts, improving data completeness for users.Type of change
Checklist: