Endless Paradigm

Full Version: I wrote a MAL searching script in bash
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
And it works pretty well, apart from a few annoyances.

I was looking for a quick way to view the synopsis and things of all the ranom anime I've downloaded that I don't remember what is, and going to the website itself is not quick. I couldn't find anything, so I whipped this up.

Basically, it searches MAL using the arguments it is given, and, if there is one result, displays some info about it, and if there are more than one, gives you a list, and prompts you to choose one.

It should work in Linux, OS X, and cygwin, provided you install xmlstarlet, which is the only requirment apart from things you should already have (curl, sed, grep, coreutils). (http://xmlstar.sourceforge.net/)

KNOWN DICKS BUGS:
Random HTML &whatever; seem to kill it. The XML parser is at fault here. I need to think of a better way to fix it, than completely removing anything matching &.*;

GET IT HERE AND STUFF: http://spoon.lembas.ws/mal.sh
If only i was Linux...

Good job though man :D
Grey Ghost Wrote: [ -> ]If only i as Linux...

Just run it under Cygwin as lembas suggested.
lembas Wrote: [ -> ]and going to the website itself is not quick. I couldn't find anything, so I whipped this up.
Tried attaching custom search keywords?  I believe Firefox, Opera and Chrome have the ability to do this.

I just type "adb super cute moe anime name" in the address bar to do a quick search.  In Firefox, go to the website, right-click the search box » Add search keyword.  I would imagine a similar procedure for Chrome.

Thanks for taking the time to write and share a script anyway!
ZiNgA BuRgA Wrote: [ -> ]
lembas Wrote: [ -> ]and going to the website itself is not quick. I couldn't find anything, so I whipped this up.
Tried attaching custom search keywords?  I believe Firefox, Opera and Chrome have the ability to do this.

I just type "adb super cute moe anime name" in the address bar to do a quick search.  In Firefox, go to the website, right-click the search box » Add search keyword.  I would imagine a similar procedure for Chrome.

Thanks for taking the time to write and share a script anyway!

Well, I use duckduckgo as my default search engine, so I can just hit 't' then type !myanimelist <stuff> but that was far too slow for what I wanted (which is what I meant by 'going to the website'); I wanted to do it out of my browser, and I couldn't find a command line program to do so.
Fair enough, just thought I'd suggest nonetheless.
You could perhaps do an alias to a browser launch command, but if you want everything displayed in a terminal, then you need your script.

It's probably more useful if you link it up to some other script though.
ZiNgA BuRgA Wrote: [ -> ]Fair enough, just thought I'd suggest nonetheless.
You could perhaps do an alias to a browser launch command, but if you want everything displayed in a terminal, then you need your script.

That's exactly what I wanted. ;)

ZiNgA BuRgA Wrote: [ -> ]It's probably more useful if you link it up to some other script though.

What do you mean by that?
Reference URL's