Post Reply 
I wrote a MAL searching script in bash
Author Message
lembas
yuri princess

Posts: 4,365.2931
Threads: 184
Joined: 30th Apr 2008
Reputation: -2.56923
E-Pigs: 154.3525
Offline
Post: #1
I wrote a MAL searching script in bash
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

I'm gay.
Spoiler for online game stuff:
[Image: 76561198003967361.png]
[Image: thelemmingbas.png]
3DS FC: 4184-1632-9353
Spoiler:
[Image: wQZsI.jpg]
Spoiler:
In the words of the wise trademark91:
windows Proud
(This post was last modified: 13/06/2012 06:08 PM by lembas.)
13/06/2012 04:09 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Grey Ghost
Still kicking!
Fractal Insanity

Posts: 3,996.1377
Threads: 112
Joined: 26th May 2009
Reputation: -5.01013
E-Pigs: 161.5986
Offline
Post: #2
RE: I wrote a MAL searching script in bash
If only i was Linux...

Good job though man :D
(This post was last modified: 14/06/2012 01:42 AM by Grey Ghost.)
13/06/2012 05:42 PM
Find all posts by this user Quote this message in a reply
Assassinator
...

Posts: 6,646.6190
Threads: 176
Joined: 24th Apr 2007
Reputation: 8.53695
E-Pigs: 140.8363
Offline
Post: #3
RE: I wrote a MAL searching script in bash
(13/06/2012 05:42 PM)Grey Ghost Wrote:  If only i as Linux...

Just run it under Cygwin as lembas suggested.
13/06/2012 05:55 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA
Smart Alternative

Posts: 17,023.4213
Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.0333
Offline
Post: #4
RE: I wrote a MAL searching script in bash
(13/06/2012 04:09 PM)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!
(This post was last modified: 13/06/2012 06:36 PM by ZiNgA BuRgA.)
13/06/2012 06:35 PM
Visit this user's website Find all posts by this user Quote this message in a reply
lembas
yuri princess

Posts: 4,365.2931
Threads: 184
Joined: 30th Apr 2008
Reputation: -2.56923
E-Pigs: 154.3525
Offline
Post: #5
RE: I wrote a MAL searching script in bash
(13/06/2012 06:35 PM)ZiNgA BuRgA Wrote:  
(13/06/2012 04:09 PM)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.

I'm gay.
Spoiler for online game stuff:
[Image: 76561198003967361.png]
[Image: thelemmingbas.png]
3DS FC: 4184-1632-9353
Spoiler:
[Image: wQZsI.jpg]
Spoiler:
In the words of the wise trademark91:
windows Proud
13/06/2012 08:03 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA
Smart Alternative

Posts: 17,023.4213
Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.0333
Offline
Post: #6
RE: I wrote a MAL searching script in bash
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.
14/06/2012 06:02 AM
Visit this user's website Find all posts by this user Quote this message in a reply
lembas
yuri princess

Posts: 4,365.2931
Threads: 184
Joined: 30th Apr 2008
Reputation: -2.56923
E-Pigs: 154.3525
Offline
Post: #7
RE: I wrote a MAL searching script in bash
(14/06/2012 06:02 AM)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. ;)

(14/06/2012 06:02 AM)ZiNgA BuRgA Wrote:  It's probably more useful if you link it up to some other script though.

What do you mean by that?

I'm gay.
Spoiler for online game stuff:
[Image: 76561198003967361.png]
[Image: thelemmingbas.png]
3DS FC: 4184-1632-9353
Spoiler:
[Image: wQZsI.jpg]
Spoiler:
In the words of the wise trademark91:
windows Proud
16/06/2012 09:06 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

 Quick Theme: