mirror of
https://github.com/D4Vinci/Scrapling.git
synced 2026-09-14 20:07:02 +08:00
docs: add stars history manually because of Github API changes
Ref.: https://www.star-history.com/blog/github-stargazer-api-restriction
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 138 KiB |
+2
-26
@@ -155,35 +155,11 @@ MySpider().start()
|
||||
Scrapling’s GitHub stars have grown steadily since its release (see chart below).
|
||||
|
||||
<div id="chartContainer">
|
||||
<a href="https://github.com/D4Vinci/Scrapling">
|
||||
<img id="chartImage" alt="Star History Chart" loading="lazy" src="https://api.star-history.com/svg?repos=D4Vinci/Scrapling&type=Date" height="400"/>
|
||||
<a href="https://www.star-history.com/?repos=D4vinci%2FScrapling&type=date&legend=top-left">
|
||||
<img id="chartImage" alt="Star History Chart" loading="lazy" src="assets/star-history.png" height="400"/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const observer = new MutationObserver((mutations) => {
|
||||
mutations.forEach((mutation) => {
|
||||
if (mutation.attributeName === 'data-md-color-media') {
|
||||
const colorMedia = document.body.getAttribute('data-md-color-media');
|
||||
const isDarkScheme = document.body.getAttribute('data-md-color-scheme') === 'slate';
|
||||
const chartImg = document.querySelector('#chartImage');
|
||||
const baseUrl = 'https://api.star-history.com/svg?repos=D4Vinci/Scrapling&type=Date';
|
||||
|
||||
if (colorMedia === '(prefers-color-scheme)' ? isDarkScheme : colorMedia.includes('dark')) {
|
||||
chartImg.src = `${baseUrl}&theme=dark`;
|
||||
} else {
|
||||
chartImg.src = baseUrl;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.body, {
|
||||
attributes: true,
|
||||
attributeFilter: ['data-md-color-media', 'data-md-color-scheme']
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
## Installation
|
||||
Scrapling requires Python 3.10 or higher:
|
||||
|
||||
Reference in New Issue
Block a user