Repository navigation
info provider for pololu.com - #1577
Merged
Merged
Conversation
Pololu has no API, so like the Pollin and Reichelt providers this one reads the website: the products-only search for keywords and item numbers, and the product page for name, description, brand, status, category, all pictures, price breaks and stock. Specifications and file downloads (dimension diagrams, 3D models, datasheets) live on separate tabs, which are only requested when the product page links them, so a lookup needs at most three page requests. The Pololu item number is the provider id and order number. It is only used as MPN for Pololu's own products, as the shop also sells other brands. Pololu is a small shop, so the page requests are spaced by a configurable delay (PROVIDER_POLOLU_REQUEST_DELAY) and the provider stops sending requests for an hour once the site answers with 403, 429 or 503.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1577 +/- ##
============================================
+ Coverage 64.46% 64.66% +0.20%
- Complexity 10210 10316 +106
============================================
Files 762 763 +1
Lines 32711 32977 +266
============================================
+ Hits 21087 21326 +239
- Misses 11624 11651 +27 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
Looks good. Thank you. |
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.
Adds an info provider for the Pololu shop, in the style of the Pollin and Reichelt providers: pololu.com has no API, so it reads the shop's pages. It needs no key and is off until
PROVIDER_POLOLU_ENABLED=1is set.What it does:
URLHandlerInfoProviderInterfaceforpololu.com/product/<n>URLs.Politeness:
requestDelaysetting (PROVIDER_POLOLU_REQUEST_DELAY, default 1 s) is the minimum time between two page requests; the last-request time is kept in the cache so it holds across requests.Includes unit tests with mocked HTTP (11 tests), the settings class, four translation strings and a docs section.
Notes for review: