The user comonoid contributed a bookmarklet for importing a game record from Board Game Arena, PlayOK, or Little Golem directly into HexWorld. To use it, copy the following text and paste it into the "URL" portion of a bookmark:
javascript:void function(){const a="https://hexworld.org/board/#";const e=window.location.href;const r=e.match(/\/table\?table=(\d+)/);const t=e.match(/\/gamereview\?table=(\d+)/);const n=e.match(/\/replay\/.*?\/\?table=\d+/);function o(e){return e.match(/\/(\d+\/hex)\?table=(\d+)/)}const i=o(e);let s="";if(typeof bgaConfig==="undefined")console.error('No "bgaConfig" variable found, cannot get the request token');else s=bgaConfig.requestToken;function c(e){let a;let i;return e.reduce((e,r)=>[...e,...r.data],[]).map(({type:e,args:r,log:t})=>{if(e==="message"&&r.size){if(r.red&&!a)a=String(r.red);else console.warn('No "args.red"');const n=r.size.match(/(\d+)x\d+/);if(n)return n[1]+"c1,"}if(e==="playToken"){if(!a)a=r.player_id;const o=i==r.player_id?":p"+r.coord:r.coord;i=r.player_id;return o}if(e==="swapPieces"){i=r.player_id;return":s"}if(e==="pass"){i=r.player_id;return":p"}if(e==="resign"||e==="playerConcedeGame"){return r.player_id==a?":rb":":rw"}}).join("")}function l(e){return fetch(window.location.origin+e,{cache:"no-cache",headers:{"X-Request-Token":s}})}function f(e){console.info(`Requesting table archives for #${e}`);return l(`/gamereview/gamereview/requestTableArchive.html?table=${e}`).then(e=>e.json()).then(e=>{if(e.status===1)return;if(e.error)throw new Error(`Error while requesting the table archive: ${e.error}`);console.warn("result.status !== 1",e)})}function d(t,e,r){const n=t?`/archive/archive/logs.html?table=${e}`:`/${r}/hex/notificationHistory.html?table=${e}&from=1&privateinc=1&history=1`;return l(n).then(e=>e.json()).then(e=>{if(String(e.status)==="0"&&e.error){throw new Error(`Error while fetching the move history: ${e.error}`)}const r=t?e.data.data.data:e.data.data;console.info("Events:",r);return c(r)})}function h(r,t,n){const o=window.open("about:blank");o.document.write("<p>Loading...</p>");d(r,t,n).catch(e=>{if(e instanceof Error&&e.message.includes("Cannot find gamenotifs log file of an archived table"))return f(t).then(()=>d(r,t,n));throw e}).then(e=>{console.info(`HexWorld hash: ${e}`);o.location.href=a+e}).catch(e=>{o.close();console.error(e);window.alert(String(e))})}if(i){const u=i[1];const w=i[2];h(false,w,u);return}if(r){const w=r[1];const g=document.querySelector("#access_game_panel");if(g&&g.style.display!=="none"){const m=document.querySelector("#view_end_btn");if(!m||!m.href)return window.alert("Error: Cannot find #view_end_btn");const b=o(m.href);if(!b)return window.alert(`Cannot parse the url: ${m.href}`);h(false,b[2],b[1]);return}if(!g)console.warn("Cannot detect if the game is finished.");h(true,w);return}if(t){h(true,t[1]);return}if(n){const p=g_gamelogs;if(!p)return window.alert('Error. No "g_gamelogs" variable found.');const v=c(p);window.open(a+v);return}window.alert("No table found. Use this bookmark while viewing a Hex game on Board Game Arena.")}();
You can then use this bookmark from any Hex game on Board Game Arena, PlayOK, or Little Golem. On BGA, it works both for completed games and games in progress, and can be used on /hex, /table, /gamereview, or /archive/replay pages. On PlayOK, it works on finished games. Watch this short video to see how to set up and use the bookmarklet: Firefox, Chrome, Edge, Android.
Update 2022/05/17. The bookmarklet was updated due to a change on Board Game Arena.
Update 2023/04/28. The bookmarklet was updated due to a change on Board Game Arena.
Update 2024/08/29. Integrated support for Little Golem and PlayOK besides the existing BGA support.
Update 2026/07/09. The bookmarklet was updated due to a change on Board Game Arena. To fix an existing bookmarklet, right-click it and choose "Edit Bookmark". Then replace the contents of the URL field with the above updated code.
To import a game from Little Golem, you can also select "Import from Little Golem" in the menu, and enter the game number.
To import a game from PlayHex, go to the
tab and select
,
or click
below any game and select
.
This does not work during certain ranked games in progress.
The URL hash field (the part after "#") contains a complete representation of the board and game state. Not all types of moves are accessible in the user interface. The syntax is:
⟨hash⟩ ::= ⟨size⟩⟨config⟩*,⟨move⟩*,⟨move⟩* (trailing commas can be omitted)
⟨size⟩ ::= ⟨n⟩ (board size: 1–53)
| ⟨n⟩x⟨n⟩ (board size: 1–53)
⟨config⟩ ::= r⟨n⟩ (rotation: 1–12, clock direction for cell a1)
| n (turn on move numbers)
| c1 (red-blue mode)
⟨move⟩ ::= ⟨cell⟩ (normal move)
| :s (swap pieces)
| :S (swap sides)
| :p (pass)
| :rb (Black resigns)
| :rw (White resigns)
| :fb (Black forfeits)
| :fw (White forfeits)
⟨n⟩ is an integer, such as 11.
⟨cell⟩ is a cell name, such as a1.
The comma in the move list indicates the current move.
The direct URL for importing a Little Golem game is https://hexworld.org/lg/?game=NNNNN, where NNNNN is the game number.
© 2021–2024 Peter Selinger, selinger@mathstat.dal.ca.
With contributions from comonoid.