offline-fantasy-name-generators

Offline version of www.fantasynamegenerators.com
git clone https://git.neptards.moe/neptards/offline-fantasy-name-generators.git
Log | Files | Refs | README

README.md (3681B)


      1 # Offline Fantasy Name Generators
      2 
      3 Generators from www.fantasynamegenerators.com in your CLI, without requiring an
      4 internet connection, or running bloated web browsers. It uses [nodejs][] to run
      5 the javascript code, and emulates enough of the Browser APIs (and jQuery) to
      6 successfully run the generators.
      7 
      8 ## Is this legal?
      9 
     10 Probably not. From the site:
     11 
     12 > You're free to use names on this site to name anything in any of your own works, assuming they aren't already trademarked by others of course.
     13 > All background images part of the generators are part of the public domain and thus free to be used by anybody,
     14 > with the exception of user submitted backgrounds, images part of existing, copyrighted works, and the pet name generator images.
     15 > All other original content is part of FantasyNameGenerators.com and cannot be copied, sold or redistributed without permission.
     16 >
     17 > Copyright© 2012-2023 FantasyNameGenerators.com.
     18 
     19 On the other hand, you also break the copyright by visiting the site, since your
     20 browser will copy the contents of the site into your local cache...
     21 
     22 ## Install
     23 
     24 You need [nodejs][] and install the packages:
     25 
     26     npm i
     27 
     28 ## Usage
     29 
     30 Run the script without args to get the available generators:
     31 
     32     ./fantasy.js
     33 
     34 Then run it with the generator name as an argument:
     35 
     36     ./fantasy.js 'Other Names > Anime & Manga Names > English names'
     37     ./fantasy.js 'Other Names' 'Anime & Manga Names' 'English names'
     38 
     39 If you have [fzf][] or similar, you can have an interactive chooser:
     40 
     41     ./fantasy.js "$(./fantasy.js | fzf)"
     42 
     43 Whoa, you just increased your productivity by 1000 times!
     44 
     45 ## Update
     46 
     47 If you're brave, you might try to update the generators from the website. If it
     48 breaks, you keep both parts. Make sure you have no untracked files in
     49 `generators` directory, because it will be deleted.
     50 
     51 First, you need [js-beautify][] in path, [ruby][ruby] 3.2, and a few gems:
     52 
     53     gem install async-http addressable nokogiri
     54 
     55 Then run `./update_generators.rb`.
     56 
     57 It's recommended to set the `CACHE` environment to an empty directory, this way
     58 it will cache downloaded files from the server, so if your network connection is
     59 spotty or you try to debug the script, you can save yourself from having to
     60 download the same files again and again.
     61 
     62 ## Test
     63 
     64 Run `./test.sh`.
     65 
     66 Note that it will likely fail a few tests, the generators are generally poorly
     67 written, they use global variables sometimes without initializing, sometimes
     68 they use a non-existing variable, sometimes they get in infinite loop, etc. For
     69 example, with the above-mentioned [anime manga names][], open the developer
     70 console, and press French names a few times, and you'll get an exception in the
     71 console. I've fixed some of the most common and easily fixable problems, but
     72 there are still a bunch of flaky generators.
     73 
     74 It's less a problem in the browser, because the error message is hidden, and
     75 you're less likely to get an uninitialized variable on subsequent generations,
     76 but this CLI tool is pretty noisy when it fails.
     77 
     78 ## License
     79 
     80 The files outside the `generators` directory are licensed under the WTFPL.
     81 
     82 This program is free software. It comes without any warranty, to the extent
     83 permitted by applicable law. You can redistribute it and/or modify it under the
     84 terms of the Do What The Fuck You Want To Public License, Version 2, as
     85 published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
     86 
     87 [nodejs]: https://nodejs.org/
     88 [fzf]: https://github.com/junegunn/fzf
     89 [ruby]: https://www.ruby-lang.org/en/
     90 [js-beautify]: https://github.com/beautify-web/js-beautify
     91 [anime manga names]: https://web.archive.org/web/20230131174447/https://www.fantasynamegenerators.com/anime-manga-names.php