Compare commits
4 commits
91a7439007
...
d1c348a853
Author | SHA1 | Date | |
---|---|---|---|
d1c348a853 | |||
04735851be | |||
b39a4f2000 | |||
c95717c9dc |
3 changed files with 83 additions and 35 deletions
|
@ -20,18 +20,6 @@
|
||||||
(define storage-path (anytime-path ".." "storage"))
|
(define storage-path (anytime-path ".." "storage"))
|
||||||
(define database-file (build-path storage-path "archiver.db"))
|
(define database-file (build-path storage-path "archiver.db"))
|
||||||
|
|
||||||
(define migrations
|
|
||||||
(wrap-sql
|
|
||||||
((query-exec slc "create table page (wikiname TEXT NOT NULL, basename TEXT NOT NULL, progress INTEGER NOT NULL, PRIMARY KEY (wikiname, basename))")
|
|
||||||
(query-exec slc "create table wiki (wikiname TEXT NOT NULL, progress INTEGER, PRIMARY KEY (wikiname))"))
|
|
||||||
((query-exec slc "create table special_page (wikiname TEXT NOT NULL, key TEXT NOT NULL, basename TEXT NOT NULL, PRIMARY KEY (wikiname, key))"))
|
|
||||||
((query-exec slc "update wiki set progress = 2 where wikiname in (select wikiname from wiki inner join page using (wikiname) group by wikiname having min(page.progress) = 1)"))
|
|
||||||
((query-exec slc "create table image (wikiname TEXT NOT NULL, hash TEXT NTO NULL, url TEXT NOT NULL, ext TEXT, source INTEGER NOT NULL, progress INTEGER NOT NULL, PRIMARY KEY (wikiname, hash))"))
|
|
||||||
((query-exec slc "alter table wiki add column sitename TEXT")
|
|
||||||
(query-exec slc "alter table wiki add column basepage TEXT")
|
|
||||||
(query-exec slc "alter table wiki add column license_text TEXT")
|
|
||||||
(query-exec slc "alter table wiki add column license_url TEXT"))))
|
|
||||||
|
|
||||||
(define slc (box #f))
|
(define slc (box #f))
|
||||||
(define (get-slc)
|
(define (get-slc)
|
||||||
(define slc* (unbox slc))
|
(define slc* (unbox slc))
|
||||||
|
@ -50,6 +38,18 @@
|
||||||
0)])
|
0)])
|
||||||
(query-value slc* "select version from database_version")))
|
(query-value slc* "select version from database_version")))
|
||||||
|
|
||||||
|
(define migrations
|
||||||
|
(wrap-sql
|
||||||
|
((query-exec slc* "create table page (wikiname TEXT NOT NULL, basename TEXT NOT NULL, progress INTEGER NOT NULL, PRIMARY KEY (wikiname, basename))")
|
||||||
|
(query-exec slc* "create table wiki (wikiname TEXT NOT NULL, progress INTEGER, PRIMARY KEY (wikiname))"))
|
||||||
|
((query-exec slc* "create table special_page (wikiname TEXT NOT NULL, key TEXT NOT NULL, basename TEXT NOT NULL, PRIMARY KEY (wikiname, key))"))
|
||||||
|
((query-exec slc* "update wiki set progress = 2 where wikiname in (select wikiname from wiki inner join page using (wikiname) group by wikiname having min(page.progress) = 1)"))
|
||||||
|
((query-exec slc* "create table image (wikiname TEXT NOT NULL, hash TEXT NTO NULL, url TEXT NOT NULL, ext TEXT, source INTEGER NOT NULL, progress INTEGER NOT NULL, PRIMARY KEY (wikiname, hash))"))
|
||||||
|
((query-exec slc* "alter table wiki add column sitename TEXT")
|
||||||
|
(query-exec slc* "alter table wiki add column basepage TEXT")
|
||||||
|
(query-exec slc* "alter table wiki add column license_text TEXT")
|
||||||
|
(query-exec slc* "alter table wiki add column license_url TEXT"))))
|
||||||
|
|
||||||
(let do-migrate-step ()
|
(let do-migrate-step ()
|
||||||
(when (database-version . < . (length migrations))
|
(when (database-version . < . (length migrations))
|
||||||
(call-with-transaction
|
(call-with-transaction
|
||||||
|
|
|
@ -198,30 +198,21 @@
|
||||||
(λ (v) (u-proxy-url v))
|
(λ (v) (u-proxy-url v))
|
||||||
(head-data^-icon-url head-data))))))
|
(head-data^-icon-url head-data))))))
|
||||||
(body (@ (class ,(head-data^-body-class head-data)))
|
(body (@ (class ,(head-data^-body-class head-data)))
|
||||||
,(if (config-true? 'instance_is_official)
|
,(let ([extension-eligible?
|
||||||
(let ([balloon '(img (@ (src "/static/three-balloons.png") (class "bw-balloon") (title "Image Source: pngimg.com/image/4955 | License: CC BY-NC 4.0 | Modifications: Resized") (width "52") (height "56")))]
|
(cond/var
|
||||||
[extension-eligible?
|
[(not req) #f]
|
||||||
(cond/var
|
(var ua-pair (assq 'user-agent (request-headers req)))
|
||||||
[(not req) #f]
|
[(not ua-pair) #f]
|
||||||
(var ua-pair (assq 'user-agent (request-headers req)))
|
(var ua (string-downcase (cdr ua-pair)))
|
||||||
[(not ua-pair) #f]
|
;; everyone pretends to be chrome, so we do it in reverse
|
||||||
(var ua (string-downcase (cdr ua-pair)))
|
;; this excludes common browsers that don't support the extension
|
||||||
;; everyone pretends to be chrome, so we do it in reverse
|
[#t (and (not (string-contains? ua "edge/"))
|
||||||
;; this excludes common browsers that don't support the extension
|
(not (string-contains? ua "mobile")))])])
|
||||||
[#t (and (not (string-contains? ua "edge/"))
|
(if extension-eligible?
|
||||||
(not (string-contains? ua "edg/"))
|
|
||||||
(not (string-contains? ua "mobile")))])])
|
|
||||||
`(div (@ (class "bw-top-banner"))
|
`(div (@ (class "bw-top-banner"))
|
||||||
,balloon
|
(div (@ (class "bw-top-banner-rainbow"))
|
||||||
(div
|
"Try " (a (@ (href "https://getindie.wiki/") (target "_blank")) "our affiliated browser extension") " - redirect to BreezeWiki automatically!\n"))
|
||||||
"BreezeWiki is back! Most major wikis are available.\n"
|
""))
|
||||||
,(if extension-eligible?
|
|
||||||
'(div (@ (class "bw-top-banner-rainbow"))
|
|
||||||
"Try " (a (@ (href "https://getindie.wiki/") (target "_blank")) "our affiliated browser extension") " - redirect to BreezeWiki automatically!\n")
|
|
||||||
"")
|
|
||||||
"As always, " (a (@ (href "https://docs.breezewiki.com/Reporting_Bugs.html")) "please go here") " to report problems, suggest features, or talk about the project.")
|
|
||||||
,balloon))
|
|
||||||
"")
|
|
||||||
(div (@ (class "main-container"))
|
(div (@ (class "main-container"))
|
||||||
(div (@ (class "fandom-community-header__background tileHorizontally header")))
|
(div (@ (class "fandom-community-header__background tileHorizontally header")))
|
||||||
(div (@ (class "page"))
|
(div (@ (class "page"))
|
||||||
|
|
|
@ -33,6 +33,12 @@
|
||||||
'(("Announcement: New Official Terraria Wiki!" . "https://forums.terraria.org/index.php?threads/new-official-terraria-wiki-launches-today.111239/") ("In the media" . "https://www.pcgamesn.com/terraria/wiki"))
|
'(("Announcement: New Official Terraria Wiki!" . "https://forums.terraria.org/index.php?threads/new-official-terraria-wiki-launches-today.111239/") ("In the media" . "https://www.pcgamesn.com/terraria/wiki"))
|
||||||
(λ (props) '()))
|
(λ (props) '()))
|
||||||
|
|
||||||
|
'Calamity_Mod
|
||||||
|
(extwiki-group^
|
||||||
|
"Calamity Mod"
|
||||||
|
'(("Announcement: Moving to wiki.gg" . "https://www.reddit.com/r/CalamityMod/comments/ts0586/important_calamity_wiki_announcement/"))
|
||||||
|
(λ (props) '()))
|
||||||
|
|
||||||
'ARK
|
'ARK
|
||||||
(extwiki-group^
|
(extwiki-group^
|
||||||
"ARK"
|
"ARK"
|
||||||
|
@ -47,6 +53,22 @@
|
||||||
'(("Migration discussion" . "https://old.reddit.com/r/Astroneer/comments/z905id/the_official_astroneer_wiki_has_moved_to_wikigg/") ("Migration info" . "https://astroneer.fandom.com/wiki/Talk:Astroneer_Wiki/Migration_to_Wiki.gg"))
|
'(("Migration discussion" . "https://old.reddit.com/r/Astroneer/comments/z905id/the_official_astroneer_wiki_has_moved_to_wikigg/") ("Migration info" . "https://astroneer.fandom.com/wiki/Talk:Astroneer_Wiki/Migration_to_Wiki.gg"))
|
||||||
(λ (props) '()))
|
(λ (props) '()))
|
||||||
|
|
||||||
|
'RuneScape
|
||||||
|
(extwiki-group^
|
||||||
|
"RuneScape"
|
||||||
|
'(("Leaving Wikia" . "https://runescape.wiki/w/Forum:Leaving_Wikia")
|
||||||
|
("In the media" . "https://kotaku.com/video-game-wikis-abandon-their-platform-after-year-of-p-1829401866")
|
||||||
|
("Browser Extension" . "https://runescape.wiki/w/RuneScape:Finding_the_wikis_with_ease#Extensions"))
|
||||||
|
(λ (props) '()))
|
||||||
|
|
||||||
|
'OSRS
|
||||||
|
(extwiki-group^
|
||||||
|
"OSRS"
|
||||||
|
'(("Leaving Wikia" . "https://runescape.wiki/w/Forum:Leaving_Wikia")
|
||||||
|
("In the media" . "https://kotaku.com/video-game-wikis-abandon-their-platform-after-year-of-p-1829401866")
|
||||||
|
("Browser Extension" . "https://oldschool.runescape.wiki/w/RuneScape:Finding_the_wikis_with_ease#Extensions"))
|
||||||
|
(λ (props) '()))
|
||||||
|
|
||||||
'empty
|
'empty
|
||||||
(extwiki-group^
|
(extwiki-group^
|
||||||
"Misc"
|
"Misc"
|
||||||
|
@ -323,6 +345,23 @@
|
||||||
"https://cdn.seiwanetwork.org/thumb/9/94/Square_Enix_Wiki_Logo.png/200px-Square_Enix_Wiki_Logo.png"
|
"https://cdn.seiwanetwork.org/thumb/9/94/Square_Enix_Wiki_Logo.png/200px-Square_Enix_Wiki_Logo.png"
|
||||||
(λ (props) '((p "The Square Enix Wiki was founded on February 8, 2012, and is an up-and-coming wiki project created by SEIWA. It focuses on covering all things Square Enix, from its video game series to its physical publications to its most notable employees and work as a company."))))
|
(λ (props) '((p "The Square Enix Wiki was founded on February 8, 2012, and is an up-and-coming wiki project created by SEIWA. It focuses on covering all things Square Enix, from its video game series to its physical publications to its most notable employees and work as a company."))))
|
||||||
|
|
||||||
|
(extwiki^
|
||||||
|
'("terraria") 'default
|
||||||
|
'Terraria
|
||||||
|
"Official Terraria Wiki"
|
||||||
|
"https://terraria.wiki.gg/wiki/Terraria_Wiki"
|
||||||
|
"https://terraria.wiki.gg/images/5/5a/App_icon_1.3_Update.png"
|
||||||
|
(λ (props)
|
||||||
|
`()))
|
||||||
|
|
||||||
|
(extwiki^
|
||||||
|
'("calamitymod" "calamity-mod") 'empty
|
||||||
|
'Calamity_Mod
|
||||||
|
"Official Calamity Mod Wiki"
|
||||||
|
"https://calamitymod.wiki.gg/wiki/Calamity_Mod_Wiki"
|
||||||
|
#f
|
||||||
|
#f)
|
||||||
|
|
||||||
(extwiki^
|
(extwiki^
|
||||||
'("ark" "ark-survival-evolved-archive") 'default
|
'("ark" "ark-survival-evolved-archive") 'default
|
||||||
'ARK
|
'ARK
|
||||||
|
@ -332,6 +371,24 @@
|
||||||
(λ (props)
|
(λ (props)
|
||||||
`((p "The official ARK: Survival Evolved Wiki launched in 2016. In April 2022 it moved to wiki.gg's hosting to improve creative control and the overall browsing experience."))))
|
`((p "The official ARK: Survival Evolved Wiki launched in 2016. In April 2022 it moved to wiki.gg's hosting to improve creative control and the overall browsing experience."))))
|
||||||
|
|
||||||
|
(extwiki^
|
||||||
|
'("runescape") 'default
|
||||||
|
'RuneScape
|
||||||
|
"RuneScape Wiki"
|
||||||
|
"https://runescape.wiki/"
|
||||||
|
"https://runescape.wiki/images/Wiki.png"
|
||||||
|
(λ (props)
|
||||||
|
`((p "The RuneScape Wiki was founded on April 8, 2005. In October 2018, the wiki left Fandom (then Wikia), citing their apathy towards the wiki and excessive advertisements."))))
|
||||||
|
|
||||||
|
(extwiki^
|
||||||
|
'("oldschoolrunescape") 'default
|
||||||
|
'OSRS
|
||||||
|
"Old School RuneScape Wiki"
|
||||||
|
"https://oldschool.runescape.wiki/"
|
||||||
|
"https://oldschool.runescape.wiki/images/Wiki.png"
|
||||||
|
(λ (props)
|
||||||
|
`((p "The Old School RuneScape Wiki was founded on February 14, 2013. In October 2018, the RuneScape Wiki left Fandom (then Wikia), citing their apathy towards the wiki and excessive advertisements, with the Old School RuneScape Wiki following suit."))))
|
||||||
|
|
||||||
(extwiki^
|
(extwiki^
|
||||||
'("astroneer") 'default
|
'("astroneer") 'default
|
||||||
'Astroneer
|
'Astroneer
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue