Skip to content
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

Add script to update showcase sites #630

Merged
merged 4 commits into from Mar 27, 2023
Merged

Add script to update showcase sites #630

merged 4 commits into from Mar 27, 2023

Conversation

delucis
Copy link
Member

@delucis delucis commented Mar 25, 2023

This adds a script and associated weekly GitHub workflow that does the following:

  1. Loads all comments in Companies & Websites Using Astro roadmap#521
  2. Extracts URLs
  3. Filters out URLs that don’t appear to be built with Astro (or which are already in the showcase)
  4. Takes a screenshot and extracts a page title for each URL
  5. Writes Markdown files to src/content/collections and resizes and saves the screenshots as WebP for each URL
  6. Opens a PR documenting the sites added, and listing sites where scraping failed or which we can’t detect are built with Astro
Example PR body:

This PR is auto-generated by a GitHub action that runs every Monday to update the Astro showcase with data from GitHub and NPM.

Sites added in this PR 🆕

Sites that failed while scraping 🚨

These sites are new additions and appear to be built with Astro, but something went wrong while trying to scrape them. You might want to add them to the showcase manually.

Sites that are maybe not built with Astro 🤔

We couldn’t detect that these sites were built with Astro. You might want to check manually.

https://mujs.dev/, https://ahuja-lab.in/

You can also run the script locally — pnpm update:showcase — and commit the resulting files manually.

@netlify
Copy link

netlify bot commented Mar 25, 2023

Deploy Preview for astro-www-2 ready!

Name Link
🔨 Latest commit e30933d
🔍 Latest deploy log https://app.netlify.com/sites/astro-www-2/deploys/6421ceace631d20008c0ea9f
😎 Deploy Preview https://deploy-preview-630--astro-www-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@tony-sull tony-sull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Added a couple comments while I'm thinking through other reliable markers a site might be built with Astro

package.json Show resolved Hide resolved
scripts/update-showcase.mjs Show resolved Hide resolved
Copy link
Contributor

@tony-sull tony-sull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thanks Chris! Very nice to have this automated for easier PR reviews 🚀

@delucis delucis merged commit 459a9c0 into main Mar 27, 2023
6 checks passed
@delucis delucis deleted the chris/showcase branch March 27, 2023 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants