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

162 dead links on phaser.io #6758

Open
akesterson opened this issue Mar 3, 2024 · 2 comments
Open

162 dead links on phaser.io #6758

akesterson opened this issue Mar 3, 2024 · 2 comments

Comments

@akesterson
Copy link

akesterson commented Mar 3, 2024

Version

  • Phaser Version: All versions on phaser.io
  • Operating system: N/A
  • Browser: N/A

Description

There are 162 broken links on the phaser.io website. The complete list is attached as brokenlinks.csv.

$ head -n 5 brokenlinks.csv
BROKEN_LINK,REFERRER
/phaser3/devlog,https://phaser.io/learn
/learn/official-tutorials,https://phaser.io/download
/download/release/3.80.0,https://phaser.io/news/2024/02/phaser-3.80.0-released
/tutorials/community-tutorials,https://phaser.io/tutorials/getting-started-phaser3
....
  • 112 broken links are referred from news articles
  • 44 are referred from download pages
  • 3 are referred from tutorials

Example Test Code

I gathered these statistics with wget and some really really ugly bash. It is reproducible.

Gather raw output from wget --spider. Go build a bridge, this takes a while.

wget --debug --spider -r -nd -nv -l 10 -w 2 -o phaser_wget.log 2> phaser_wget.debug.log https://phaser.io/

... Parse the wget log for broken links and transform that into a CSV ...

cat phaser_wget.log |\
    grep -E '((HEAD|GET).*HTTP/1.1|^Referer:|broken link)' | \
    grep -B 2 "broken link" | \
    sed -e s/'--'//g \
        -e s/'Referer: '/''/g \
        -e s/'GET'/''/g \
        -e s/'HEAD '/''/g \
        -e s/'Remote file does not exist.*'//g \
        -e s/' HTTP\/1.1'/','/g -e s/'Found .*'//g | \
    grep -v '^$' | \
    sed s/'^\s*\/'/';\/'/g | \
    tr -d '\n\r' | \
    tr ';' '\n' > brokenlinks.csv

... stats are gathered from brokenlinks.csv :

cat brokenlinks.csv | grep -Eo '^/[a-zA-Z0-9_\-]+/' | cut -d / -f 2 | sort | uniq -c | sort -nr

Additional Information

A (much MUCH) cleaner version of that script could be ran against the generated phaser site before it is published to identify broken links as a CI/CD gateway. If someone would point me to the pipeline I'd be happy to contribute a PR for that action.

brokenlinks.csv

@akesterson
Copy link
Author

Relates to #6757

@photonstorm
Copy link
Collaborator

Thanks for the list. Dead news links I'm less bothered about, depending on the age, due to the fact we're dealing with a decade's worth of news here, so it's not surprising some of those links no longer work. We will tag old articles with a relevant warning (and potentially a link to archive.org). The other links are more important though, so we'll look at them next week.

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

No branches or pull requests

2 participants