Skip to content

Commit

Permalink
Fix bookmarklet
Browse files Browse the repository at this point in the history
  • Loading branch information
expitau committed Feb 25, 2024
1 parent e34cbad commit 06919cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Visit the [live site](https://expitau.github.io/InfiniteCraftWiki/) to see it in
This site has support for importing your crafted elements from Infinite Craft. To do this, go to https://neal.fun/infinite-craft/, right click -> Inspect element -> Console, and paste the following code:

```javascript
fetch("https://raw.githubusercontent.com/expitau/InfiniteCraftWiki/main/data.json").then(res => res.json()).then(data => { index = Object.fromEntries(Object.entries(data.index).map(x => [x[1][1], x[0]])); window.location.href = `https://expitau.github.io/InfiniteCraftWiki?s=${JSON.parse(localStorage.getItem('infinite-craft-data')).elements.map(a => index[a.text]).filter(x => x).join(",")}` })
fetch("https://raw.githubusercontent.com/expitau/InfiniteCraftWiki/main/data/data.json").then(res => res.json()).then(data => { index = Object.fromEntries(Object.entries(data.index).map(x => [x[1][1], x[0]])); window.location.href = `https://expitau.github.io/InfiniteCraftWiki?s=${JSON.parse(localStorage.getItem('infinite-craft-data')).elements.map(a => index[a.text]).filter(x => x).join(",")}` })
```

This will automatically redirect and load your data.
Expand All @@ -36,7 +36,7 @@ The data is stored in a JSON file, with two keys "index" and "data". The "index"

(This corresponds to three recipes, Wind + Earth = Dust, Fire + Earth = Lava, and Fire + Fire = Volcano. The costs are the minimal costs for each item.)

See [data.json](data.json) for the current data, and the bottom of [index.html](index.html) for a way to parse it into a dictionary of recipes and backlinks.
See [data.json](data/data.json) for the current data, and the bottom of [index.html](index.html) for a way to parse it into a dictionary of recipes and backlinks.

## Acknowledgements
- [Neal Agarwal](https://neal.fun/) for creating Infinite Craft
Expand Down
2 changes: 1 addition & 1 deletion web/bookmarklet.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 06919cc

Please sign in to comment.