Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lagleki/mietoa


https://github.com/lagleki/mietoa

Last synced: 15 days ago
JSON representation

Awesome Lists containing this project

README

        

# mietoa
Some utilities for the [toaq](http://toaq.org) language, featuring:
+ an interactive dictionary:
+ involving the files:
+ `dic.html`
+ `toaq_undiak_dict.js`
+ launch with:
+ open `dic.html` in a ⦅modern⦆ browser
+ a discord bot, able to search, match, and parse ⦅see the output of the `.h mietoa` command when invoked from discord⦆
+ involving the files:
+ all but not `dic.html`
+ launch with:
+ `node bot.js`, in a terminal with nodejs. Just fill up `bot.js` with the bot's parameters ⦅names of the authorized channels; and the bot's discord token⦆

### generate the dictionary in a json format
```bash
wget toaq.org/dictionary/; perl -i -p -e 's/\<\!DOCTYPE(.*)\n//g;' -e 's?(.*)(.*)(.*)?\{toaq:$1,t_en:$2,d_en:$3?g;' -e 's/\"/\\"/g;' -e 's/\{toaq:(.*),t_en:(.*),d_en:(.*)/\{"toaq":"$1","t_en":"$2","d_en":"$3"/g;' index.html;
cat index.html | grep '{"toaq"' > undex.html; cat index.html | grep -oP '{"toaq":.*,"t_en"' | sed -E 's/[áàâāãǎả]/a/g;s/[éèêēẽěẻ]/e/g;s/[íìîīĩǐỉ]/i/g;s/[óòôōõǒỏ]/o/g;s/[úùûūũǔủ]/u/g;s/\{\"toaq\"\:/\"toaq_undia\":/g;s/",".*/"\},/g;' > undia;
paste -d ',' undex.html undia > toaq_dict.js; rm undia; rm undex.html; rm index.html; perl -i -p -e 'print "data = [\n" if $. == 1' toaq_dict.js; echo "]" >> toaq_dict.js; perl -i -p -e 's/\r\",\"/\",\"/g;' toaq_dict.js
```