Link out to NIWA's wikis where available

This commit is contained in:
Cadence Ember 2022-10-30 23:15:26 +13:00
parent 3c7a2f8453
commit 8b200d621a
Signed by: cadence
GPG key ID: BC1C2C61CF521B17
4 changed files with 256 additions and 7 deletions

View file

@ -1,11 +1,14 @@
#lang racket/base #lang racket/base
(require racket/string (require racket/list
racket/string
json json
(prefix-in easy: net/http-easy) (prefix-in easy: net/http-easy)
html-writing html-writing
web-server/http web-server/http
"config.rkt" "config.rkt"
"data.rkt" "data.rkt"
"niwa-data.rkt"
"pure-utils.rkt"
"xexpr-utils.rkt" "xexpr-utils.rkt"
"url-utils.rkt") "url-utils.rkt")
@ -62,6 +65,35 @@
" Media files and official Fandom documents have different copying restrictions.") " Media files and official Fandom documents have different copying restrictions.")
(p ,(format "Fandom is a trademark of Fandom, Inc. ~a is not affiliated with Fandom." (config-get 'application_name)))))))) (p ,(format "Fandom is a trademark of Fandom, Inc. ~a is not affiliated with Fandom." (config-get 'application_name))))))))
;; generate a notice with a link if a fandom wiki has a replacement as part of NIWA or similar
;; if the wiki has no replacement, display nothing
(define (niwa-notice wikiname title)
(define ind (findf (λ (item) (member wikiname (first item))) niwa-data))
(if ind
(let* ([search-page (format "/Special:Search?~a"
(params->query `(("search" . ,title)
("go" . "Go"))))]
[go (if (string-suffix? (third ind) "/")
(regexp-replace "/$" (third ind) (λ (_) search-page))
(let* ([_ (println (regexp-match "/(w[^./]*)/" (third ind)))] [joiner (second (regexp-match "/(w[^./]*)/" (third ind)))])
(regexp-replace "/w[^./]*/.*$" (third ind) (λ (_) (format "/~a~a" joiner search-page)))))])
`(aside (@ (class "niwa__notice"))
(h1 (@ (class "niwa__header")) ,(second ind) " has its own website separate from Fandom.")
(a (@ (class "niwa__go") (href ,go)) "Read " ,title " on " ,(second ind) "")
(div (@ (class "niwa__cols"))
(div (@ (class "niwa__left"))
(p "Most major Nintendo wikis are part of the "
(a (@ (href "https://www.niwanetwork.org/about/")) "Nintendo Independent Wiki Alliance")
" and have their own wikis off Fandom. You can help this wiki by "
(a (@ (href ,go)) "visiting it directly."))
(p ,(fifth ind))
(div (@ (class "niwa__divider")))
(p "Why are you seeing this message? Fandom refuses to delete or archive their copy of this wiki, so that means their pages will appear high up in search results. Fandom hopes to get clicks from readers who don't know any better.")
(p (@ (class "niwa__feedback")) (a (@ (href "https://www.kotaku.com.au/2022/10/massive-zelda-wiki-reclaims-independence-six-months-before-tears-of-the-kingdom/")) "More info") " / " (a (@ (href "https://docs.breezewiki.com/Reporting_Bugs.html")) "Feedback on this notice?")))
(div (@ (class "niwa__right"))
(img (@ (class "niwa__logo") (src ,(format "https://www.niwanetwork.org~a" (fourth ind)))))))))
""))
(define (generate-wiki-page (define (generate-wiki-page
content content
#:source-url source-url #:source-url source-url
@ -107,6 +139,7 @@
(div (@ (class "fandom-community-header__background tileHorizontally header"))) (div (@ (class "fandom-community-header__background tileHorizontally header")))
(div (@ (class "page")) (div (@ (class "page"))
(main (@ (class "page__main")) (main (@ (class "page__main"))
,(niwa-notice wikiname title)
(div (@ (class "custom-top")) (div (@ (class "custom-top"))
(h1 (@ (class "page-title")) ,title) (h1 (@ (class "page-title")) ,title)
(nav (@ (class "sitesearch")) (nav (@ (class "sitesearch"))

156
src/niwa-data.rkt Normal file
View file

@ -0,0 +1,156 @@
#lang racket/base
(provide
niwa-data)
;; wikiname, niwa-name, url, logo-url
(define niwa-data
'((("arms" "armsgame")
"ARMS Institute"
"https://armswiki.org/wiki/Home"
"/images/logos/armswiki.png"
"ARMS Institute is a comprehensive resource for information about the Nintendo Switch game, ARMS. Founded on May 1, 2017 and growing rapidly, the wiki strives to offer in-depth coverage of ARMS from both a competitive and casual perspective. Join us and ARM yourself with knowledge!")
(("pokemon" "monster")
"Bulbapedia"
"https://bulbapedia.bulbagarden.net/wiki/Main_Page"
"/images/logos/bulbapedia.png"
"A part of the Bulbagarden community, Bulbapedia was founded on December 21, 2004 by Liam Pomfret. Everything you need to know about Pokémon can be found at Bulbapedia, whether about the games, the anime, the manga, or something else entirely. With its Bulbanews section and the Bulbagarden forums, it's your one-stop online place for Pokémon.")
(("dragalialost")
"Dragalia Lost Wiki"
"https://dragalialost.wiki/w/Dragalia_Lost_Wiki"
"/images/logos/dragalialost.png"
"The Dragalia Lost Wiki was originally founded in September 2018 on the Gamepedia platform but went independent in January 2021. The Wiki aims to document anything and everything Dragalia Lost, from in-game data to mechanics, story, guides, and more!")
(("dragonquest")
"Dragon Quest Wiki"
"https://dragon-quest.org/wiki/Main_Page"
"/images/logos/dragonquestwiki.png"
"Originally founded on Wikia, the Dragon Quest Wiki was largely inactive until FlyingRagnar became an admin in late 2009. The wiki went independent about a year later when it merged with the Dragon Quest Dictionary/Encyclopedia which was run by Zenithian and supported by the Dragon's Den. The Dragon Quest Wiki aims to be the most complete resource for Dragon Quest information on the web. It continues to grow in the hope that one day the series will be as popular in the rest of the world as it is in Japan.")
(("fireemblem")
"Fire Emblem Wiki"
"https://fireemblemwiki.org/wiki/Main_Page"
"/images/logos/fireemblemwiki.png"
"Growing since August 26, 2010, Fire Emblem Wiki is a project whose goal is to cover all information pertaining to the Fire Emblem series. It aspires to become the most complete and accurate independent source of information on this series.")
(("fzero" "f-zero")
"F-Zero Wiki"
"https://mutecity.org/wiki/F-Zero_Wiki"
"/images/logos/fzerowiki.png"
"Founded on Wikia in November 2007, F-Zero Wiki became independent with NIWA's help in 2011. F-Zero Wiki is quickly growing into the Internet's definitive source for the world of 2200 km/h+, from pilots to machines, and is the founding part of MuteCity.org, the web's first major F-Zero community.")
(("goldensun")
"Golden Sun Universe"
"https://www.goldensunwiki.net/wiki/Main_Page"
"/images/logos/goldensununiverse.png"
"Originally founded on Wikia in late 2006, Golden Sun Universe has always worked hard to meet one particular goal: to be the single most comprehensive yet accessible resource on the Internet for Nintendo's RPG series Golden Sun. It became an independent wiki four years later. Covering characters and plot, documenting all aspects of the gameplay, featuring walkthroughs both thorough and bare-bones, and packed with all manner of odd and fascinating minutiae, Golden Sun Universe leaves no stone unturned!")
(("tetris")
"Hard Drop - Tetris Wiki"
"https://harddrop.com/wiki/Main_Page"
"/images/logos/harddrop.png"
"The Tetris Wiki was founded by Tetris fans for Tetris fans on tetrisconcept.com in March 2006. The Tetris Wiki torch was passed to harddrop.com in July 2009. Hard Drop is a Tetris community for all Tetris players, regardless of skill or what version of Tetris you play.")
(("kidicarus")
"Icaruspedia"
"https://www.kidicaruswiki.org/wiki/Main_Page"
"/images/logos/icaruspedia.png"
"Icaruspedia is the Kid Icarus wiki that keeps flying to new heights. After going independent on January 8, 2012, Icaruspedia has worked to become the largest and most trusted independent source of Kid Icarus information. Just like Pit, they\"ll keep on fighting until the job is done.")
(("splatoon" "uk-splatoon" "splatoon3" "splatoon2")
"Inkipedia"
"https://splatoonwiki.org/wiki/Main_Page"
"/images/logos/inkipedia.png"
"Inkipedia is your ever-growing go-to source for all things Splatoon related. Though founded on Wikia on June 10, 2014, Inkipedia went independent on May 18, 2015, just days before Splatoon's release. Our aim is to cover all aspects of the series, both high and low. Come splat with us now!")
(("starfox")
"Lylat Wiki"
"https://starfoxwiki.info/wiki/Lylat_Wiki"
"/images/logos/lylatwiki.png"
"Out of seemingly nowhere, Lylat Wiki sprung up one day in early 2010. Led by creator, Justin Folvarcik, and project head, Tacopill, the wiki has reached stability since the move to its own domain. The staff of Lylat Wiki are glad to help out the NIWA wikis and are even prouder to join NIWA's ranks as the source for information on the Star Fox series.")
(("metroid" "themetroid")
"Metroid Wiki"
"https://www.metroidwiki.org/wiki/Main_Page"
"/images/logos/metroidwiki.png"
"Metroid Wiki, founded on January 27, 2010 by Nathanial Rumphol-Janc and Zelda Informer, is a rapidly expanding wiki that covers everything Metroid, from the games, to every suit, vehicle and weapon.")
(("nintendo" "nintendoseries" "nintendogames")
"Nintendo Wiki"
"http://niwanetwork.org/wiki/Main_Page"
"/images/logos/nintendowiki.png"
"Created on May 12, 2010, NintendoWiki (N-Wiki) is a collaborative project by the NIWA team to create an encyclopedia dedicated to Nintendo, being the company around which all other NIWA content is focused. It ranges from mainstream information such as the games and people who work for the company, to the most obscure info like patents and interesting trivia.")
(("animalcrossing" "animalcrossingcf" "acnh")
"Nookipedia"
"https://nookipedia.com/wiki/Main_Page"
"/images/logos/nookipedia.png"
"Founded in August 2005 on Wikia, Nookipedia was originally known as Animal Crossing City. Shortly after its five-year anniversary, Animal Crossing City decided to merge with the independent Animal Crossing Wiki, which in January 2011 was renamed to Nookipedia. Covering everything from the series including characters, items, critters, and much more, Nookipedia is your number one resource for everything Animal Crossing!")
(("pikmin")
"Pikipedia"
"https://www.pikminwiki.com/"
"/images/logos/pikipedia.png"
"Pikipedia, also known as Pikmin Wiki, was founded by Dark Lord Revan on Wikia in December 2005. In September 2010, with NIWA's help, Pikipedia moved away from Wikia to become independent. Pikipedia is working towards their goal of being the foremost source for everything Pikmin.")
(("pikmin-fan" "pikpikpedia")
"Pimkin Fanon"
"https://www.pikminfanon.com/wiki/Main_Page"
"/images/logos/pikifanon.png"
"Pikmin Fanon is a Pikmin wiki for fan stories (fanon). Founded back on November 1, 2008 by Rocky0718 as a part of Wikia, Pikmin Fanon has been independent since September 14, 2010. Check them out for fan created stories based around the Pikmin series.")
(("supersmashbros")
"SmashWiki"
"https://www.ssbwiki.com/"
"/images/logos/smashwiki.png"
"Originally two separate wikis (one on SmashBoards, the other on Wikia), SmashWiki as we know it was formed out of a merge on February 29th, 2008, becoming independent on September 28th, 2010. SmashWiki is the premier source of Smash Bros. information, from simple tidbits to detailed mechanics, and also touches on the origins of its wealth of content from its sibling franchises.")
(("starfy")
"Starfy Wiki"
"https://www.starfywiki.org/wiki/Main_Page"
"/images/logos/starfywiki.png"
"Founded on May 30, 2009, Starfy Wiki's one goal is to become the best source on Nintendo's elusive game series The Legendary Starfy. After gaining independence in 2011 with the help of Tappy and the wiki's original administrative team, the wiki still hopes to achieve its goal and be the best source of Starfy info for all present and future fans.")
(()
"StrategyWiki"
"https://www.strategywiki.org/wiki/Main_Page"
"/images/logos/strategywiki.png"
"StrategyWiki was founded in December 2005 by former member Brandon Suit with the idea that the existing strategy guides on the Internet could be improved. Three years later, in December 2008, Scott Jacobi officially established Abxy LLC for the purpose of owning and operating StrategyWiki as a community. Their vision is to bring free, collaborative video game strategy guides to the masses, including Nintendo franchise strategy guides.")
(("mario" "themario" "imario" "supermarionintendo" "mariokart" "luigi-kart" "mario3")
"Super Mario Wiki"
"https://www.mariowiki.com/"
"/images/logos/mariowiki.png"
"Online since August 12, 2005, when it was founded by Steve Shinn, Super Mario Wiki has you covered for anything Mario, Donkey Kong, Wario, Luigi, Yoshi—the whole gang, in fact. With its own large community in its accompanying forum, Super Mario Wiki is not only a great encyclopedia, but a fansite for you to talk anything Mario.")
(("mario64")
"Ukikipedia"
"https://ukikipedia.net/wiki/Main_Page"
"/images/logos/ukikipedia.png"
"Founded in 2018, Ukikipedia is a wiki focused on expert level knowledge of Super Mario 64, including detailed coverage of game mechanics, glitches, speedrunning, and challenges.")
(("advancewars")
"Wars Wiki"
"https://www.warswiki.org/wiki/Main_Page"
"/images/logos/warswiki.png"
"Created in February 2009, Wars Wiki is a small wiki community with a large heart. Founded by JoJo and Wars Central, Wars Wiki is going strong on one of Nintendo's lesser known franchises. Wars Wiki is keen to contribute to NIWA, and we're proud to be able to support them. With the Wars Central community, including forums, it's definitely worth checking out.")
(("earthbound")
"WikiBound"
"https://www.wikibound.info/wiki/WikiBound"
"/images/logos/wikibound.png"
"Founded in early 2010 by Tacopill, WikiBound strives to create a detailed database on the Mother/EarthBound games, a quaint series only having two games officially released outside of Japan. Help spread the PK Love by editing WikiBound!")
(("kirby")
"WiKirby"
"https://wikirby.com/wiki/Kirby_Wiki"
"/images/logos/wikirby.png"
"WiKirby. It's a wiki. About Kirby! Amidst the excitement of NIWA being founded, Josh LeJeune decided to create a Kirby Wiki, due to lack of a strong independent one online. Coming online on January 24, 2010, WiKirby continues its strong launch with a dedicated community and a daily growing source of Kirby based knowledge.")
(("xenoblade" "xenoseries" "xenogears" "xenosaga")
"Xeno Series Wiki"
"https://www.xenoserieswiki.org/wiki/Main_Page"
"/images/logos/xenoserieswiki.png"
"Xeno Series Wiki was created February 4, 2020 by Sir Teatei Moonlight. While founded by the desire to have an independent wiki for Xenoblade, there was an interest in including the Xenogears and Xenosaga games within its focus as well. This wide range of coverage means it's always in need of new editors to help bolster its many subjects.")
(("zelda" "zelda-archive")
"Zeldapedia"
"https://zeldapedia.wiki/wiki/Main_Page"
"/images/logos/zeldapedia.png"
"Founded on April 23, 2005 as Zelda Wiki, today's Zeldapedia is your definitive source for encyclopedic information on The Legend of Zelda series, as well as all of the latest Zelda news.")))
;; get the current dataset so it can be stored above
(module+ test
(require racket/generator
racket/list
net/http-easy
html-parsing
"xexpr-utils.rkt")
(define r (get "https://www.niwanetwork.org/members/"))
(define x (html->xexp (bytes->string/utf-8 (response-body r))))
(define english ((query-selector (λ (e a c) (println a) (equal? (get-attribute 'id a) "content1")) x)))
(define gen (query-selector (λ (e a c) (has-class? "member" a)) english))
(for/list ([item (in-producer gen #f)])
(define links (query-selector (λ (e a c) (eq? e 'a)) item))
(define url (get-attribute 'href (bits->attributes (links))))
(define title (third (links)))
(define icon (get-attribute 'src (bits->attributes ((query-selector (λ (e a c) (eq? e 'img)) item)))))
(define description (second ((query-selector (λ (e a c) (eq? e 'p)) item))))
(list '() title url icon description)))

View file

@ -15,13 +15,11 @@
(require rackunit)) (require rackunit))
(define examples (define examples
'(("crosscode" "CrossCode_Wiki") '(("minecraft" "Bricks")
("pokemon" "Eevee") ("crosscode" "CrossCode_Wiki")
("minecraft" "Bricks")
("undertale" "Hot_Dog...%3F") ("undertale" "Hot_Dog...%3F")
("tardis" "Eleanor_Blake") ("tardis" "Eleanor_Blake")
("fireemblem" "God-Shattering_Star") ("zelda" "Boomerang")))
("fallout" "Pip-Boy_3000")))
(define content (define content
`((h2 "BreezeWiki makes wiki pages on Fandom readable") `((h2 "BreezeWiki makes wiki pages on Fandom readable")
@ -53,6 +51,8 @@
(p (@ (class "testimonial")) ">you are so right that fandom still sucks even with adblock somehow. even zapping all the stupid padding it still sucks —Minimus") (p (@ (class "testimonial")) ">you are so right that fandom still sucks even with adblock somehow. even zapping all the stupid padding it still sucks —Minimus")
(p (@ (class "testimonial")) ">attempting to go to a wiki's forum page with breezewiki doesn't work, which is based honestly —Tom Skeleton") (p (@ (class "testimonial")) ">attempting to go to a wiki's forum page with breezewiki doesn't work, which is based honestly —Tom Skeleton")
(p (@ (class "testimonial")) ">Fandom pages crashing and closing, taking forever to load and locking up as they load the ads on the site... they are causing the site to crash because they are trying to load video ads both at the top and bottom of the site as well as two or three banner ads, then a massive top of site ad and eventually my anti-virus shuts the whole site down because it's literally pulling more resources than WoW in ultra settings... —Anonymous") (p (@ (class "testimonial")) ">Fandom pages crashing and closing, taking forever to load and locking up as they load the ads on the site... they are causing the site to crash because they are trying to load video ads both at the top and bottom of the site as well as two or three banner ads, then a massive top of site ad and eventually my anti-virus shuts the whole site down because it's literally pulling more resources than WoW in ultra settings... —Anonymous")
(p (@ (class "testimonial")) ">reblogs EXTREMELY appreciated I want that twink* (*fandom wiki) obliterated —footlong")
(h2 "What BreezeWiki isn't") (h2 "What BreezeWiki isn't")
(p "BreezeWiki isn't an \"alternative\" to Fandom, and it doesn't let you edit or write new pages.") (p "BreezeWiki isn't an \"alternative\" to Fandom, and it doesn't let you edit or write new pages.")
(p "If you want to create your own wiki, try Miraheze!"))) (p "If you want to create your own wiki, try Miraheze!")))
@ -63,7 +63,8 @@
(meta (@ (name "viewport") (content "width=device-width, initial-scale=1"))) (meta (@ (name "viewport") (content "width=device-width, initial-scale=1")))
(title "About | BreezeWiki") (title "About | BreezeWiki")
(link (@ (rel "stylesheet") (type "text/css") (href "/static/internal.css"))) (link (@ (rel "stylesheet") (type "text/css") (href "/static/internal.css")))
(link (@ (rel "stylesheet") (type "text/css") (href "/static/main.css")))) (link (@ (rel "stylesheet") (type "text/css") (href "/static/main.css")))
(link (@ (rel "icon") (href "/static/breezewiki-icon.svg"))))
(body (@ (class "skin-fandomdesktop theme-fandomdesktop-light internal")) (body (@ (class "skin-fandomdesktop theme-fandomdesktop-light internal"))
(div (@ (class "main-container")) (div (@ (class "main-container"))
(div (@ (class "fandom-community-header__background tileBoth header"))) (div (@ (class "fandom-community-header__background tileBoth header")))

View file

@ -285,6 +285,61 @@ figcaption, .lightbox-caption, .thumbcaption {
text-align: left; text-align: left;
} }
/* nintendo independent wiki alliance notice */
.niwa__notice {
background: #fdedd8;
color: black;
border: 1px dashed black;
padding: 3vw;
margin-bottom: 3vw;
border-radius: 6px;
font-size: 18px;
}
.niwa__header {
font-size: max(2.9vw, 26px);
margin-top: 0;
}
.niwa__notice a {
color: #002263;
text-decoration: underline;
}
.niwa__notice .niwa__go {
display: inline-block;
border-radius: 20px;
padding: 16px 26px;
background: #f2f65f;
color: black;
text-decoration: none;
font-size: 24px;
font-weight: bold;
line-height: 1.2;
border: 2px solid black;
box-shadow: 0 5px 0 black;
margin-bottom: 8px;
}
.niwa__notice .niwa__go:hover {
color: black;
text-decoration: underline;
background: #dee154;
}
.niwa__cols {
display: grid;
grid-template-columns: 1fr auto;
gap: 8px;
}
.niwa__logo {
width: 150px;
height: auto;
}
.niwa__divider {
height: 1px;
background: #808080;
}
.niwa__feedback {
font-size: 14px;
text-align: right;
}
/* media queries */ /* media queries */
/* for reference, cell phone screens are generally 400 px wide, definitely less than 500 px */ /* for reference, cell phone screens are generally 400 px wide, definitely less than 500 px */
@ -301,6 +356,10 @@ figcaption, .lightbox-caption, .thumbcaption {
body.skin-fandomdesktop, button, input, textarea, .wikitable, .va-table { body.skin-fandomdesktop, button, input, textarea, .wikitable, .va-table {
font-size: 16px; font-size: 16px;
} }
/* niwa layout */
.niwa__right {
display: none;
}
} }
@media (min-width: 560px) { /* wider than 560 px */ @media (min-width: 560px) { /* wider than 560 px */