command-line export?

Index » Feedback

  • 1
 
Montrealer Member
From: Canada Registered: 2008-12-27 Posts: 33

Many thanks to Fabrice for providing this wonderful site.

I'm using it in combination with a hand-held to drill the kanji I fail.  To do this, I filter the results of the http://kanji.koohii.com/status/export.php function to generate a custom list of the kanji that are imported into the hand-held for the day's practice.

I'd like to automate the process more and combine all the steps in a shell script, but so far I haven't been able to find a way to access the export page from the command line. 
Specifically, I'm not having any luck with any variation on
wget --user=my_username --password=my_password http://kanji.koohii.com/status/export.php

Does anyone have any ideas on how I can access this page from the command line?

Thanks in advance for any help,
a Montrealer

iSoron Member
From: Canada Registered: 2008-03-24 Posts: 490

Using curl:

curl --cookie-jar cookies.txt --data "uname=***&passwd=***&submit=Login" http://kanji.koohii.com/login.php > /dev/null
curl --cookie cookies.txt http://kanji.koohii.com/status/export.php

xaarg Member
From: Neverland Registered: 2007-07-13 Posts: 160

Code:

wget -q http://kanji.koohii.com/login.php \
   --post-data="uname=***&passwd=***&submit=Login" \
   http://kanji.koohii.com/status/export.php -O - | perl -n -e \
   'BEGIN{ $a=0; } print if $a; $a=1 if /framenum/'

Last edited by xaarg (2009 October 03, 7:35 pm)

Advertising (register and sign in to hide this)
JapanesePod101 Sponsor
 
Montrealer Member
From: Canada Registered: 2008-12-27 Posts: 33

Wow.  What service.  Barely and hour later and two working solutions.
Thanks again for all the help!

Sebastian Member
Registered: 2008-09-09 Posts: 582

I feel as if I were in The Matrix.

00100000 01010111 01101001 01110011 01101000 00100000 01001001 00100000 01101011 01101110 01100101 01110111 00100000 01101101 01101111 01110010 01100101 00100000 01100001 01100010 01101111 01110101 01110100 00100000 01110000 01110010 01101111 01100111 01110010 01100001 01101101 01101101 01101001 01101110 01100111 00101110 00101110 00101110 00100000 T_T

kazelee Rater Mode
From: ohlrite Registered: 2008-06-18 Posts: 2132 Website

@sebastian

It's not nice to shout in all caps (even if you do it in binary). ^^

xaarg Member
From: Neverland Registered: 2007-07-13 Posts: 160

http://img44.imageshack.us/img44/4263/65072851.jpg
Just select a proper font like Georgia to get those nice old-style digits.

cangy Member
From: 平安京 Registered: 2006-12-13 Posts: 372 Website

Montrealer wrote:

Wow.  What service.  Barely and hour later and two working solutions.
Thanks again for all the help!

just to make it 3: you can also use wget --load-cookies with your firefox cookie file

Sebastian wrote:

I feel as if I were in The Matrix.

4c 6f 6f 6b 73 20 6c 69 6b 65 20 79 6f 75 27 72 65 20 6f 66 66 20 74 6f 20 61 20 67 6f 6f 64 20 73 74 61 72 74 21

Last edited by cangy (2009 October 03, 10:58 pm)

unauthorized Member
Registered: 2009-08-04 Posts: 64

ASCII encoding is all the rage these days.

SSBwcmVmZXIgQmFzZTY0LiBJdCB3ZWVkcyBvdXQgdGhlIHNrcmlwdCBraWRkaWVzLg==

'niway, the provided solutions are actually very elegant. If it were me, I'd send raw HTTP through a direct telnet connection, if only because I'm reviewing from a Windows system.

Montrealer Member
From: Canada Registered: 2008-12-27 Posts: 33

I hope you're kidding.  Talk about using an elephant gun to kill a gnat.
BTW, most Unix tools are available for MS platforms, through Cygwin and other Gnu ports.

xaarg Member
From: Neverland Registered: 2007-07-13 Posts: 160

cangy wrote:

just to make it 3: you can also use wget --load-cookies with your firefox cookie file

That was maybe true years ago, but Firefox switched from Netscape's cookie.txt format to a Sqlite3 database.

Code:

sqlite3 `/bin/ls -1t ~/.mozilla/firefox/*.default/cookies.sqlite | head -n1` \
 "select name,value from moz_cookies where host = 'kanji.koohii.com';"

Montrealer wrote:

BTW, most Unix tools are available for MS platforms, through Cygwin and other Gnu ports.

And Windows even has its own assortment of tools, e.g. the Javascript back-end of the so called the Windows Script(ing) Host.

Last edited by xaarg (2009 October 19, 11:56 am)

Reply #12 - 2009 October 19, 9:00 pm
cangy Member
From: 平安京 Registered: 2006-12-13 Posts: 372 Website

unauthorized wrote:

ASCII encoding is all the rage these days.

SSBwcmVmZXIgQmFzZTY0LiBJdCB3ZWVkcyBvdXQgdGhlIHNrcmlwdCBraWRkaWVzLg==

if, by "these days", you  mean the early 90s...

begin 600 message
C06AH:"P@=&AI<R!B<FEN9W,@8F%C:R!M96UO<FEE<RXN+@H`
`
end

Reply #13 - 2009 October 20, 3:28 pm
unauthorized Member
Registered: 2009-08-04 Posts: 64

WSH is a terrible, terrible thing. Microsoft did well by scrapping it for PowerShell. Too bad you have to jump all over MSDN to find what you are looking for. Then there are a plethora of "P" languages that would make for a far more simple solution. But seriously, writing one POST and one GET manually isn't the end of the world.

Code:

nc kanji.koohii.com 80 < POST /url HTTP\1.1^
Host: kanji.koohii.com^
Content-Length: didn't count^
Content-Type: application/x-www-form-urlencoded^

userid=me&password=itsmypassword!

regex for the cookie and do a telnet GET. Not very pretty, but it sure beats the trouble of installing cygwin.

@cangy
That was meant as sarcasm, although a surprising number of high profile apps still use ascii. So many people fail at utf...

p.s. I don't have a uu decoder. *too lazy to boot up the VM*

Last edited by unauthorized (2009 October 20, 3:29 pm)

  • 1