Exporting stories?

Index » Feedback

  • 1
 
Reply #1 - 2006 July 28, 1:02 pm
laxxy Member
Registered: 2006-07-19 Posts: 203

Is it possible to export all stories you wrote into, e.g., a text file or a spreadsheet?
Such an ability would definitely be most helpful.

mantixen Member
From: Illinois Registered: 2006-11-10 Posts: 35 Website

i'd like to echo this request. before discovering this website, i had written all my stories from RTK1 in a notebook, but now that i've found more memorable stories and am able to input my own into an internet-accessable collection, it would be great to be able to have printable lists generated for making a new notebook, or even generate a PDF in a format similar to RTK1 that could be used for review of our stories offline. This kind of output would make the input of our stories into this website more complete and worthwhile, especially in the case that the server data is corrupted somehow.
Although this would be a time-consuming undertaking, I hope it is deemed worthwhile. Regardless, I am boundlessly thankful for the usefulness of this website and forum.

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

Me too!  Import and export.  You should be able to get your data out of any software you use, and in a portable format.

Advertising (register and sign in to hide this)
JapanesePod101 Sponsor
 
tritonxg Member
From: france Registered: 2006-09-26 Posts: 14

indeed I think it would be a great improvment if we can export the datas (when commuting 
I could spare time if I could use these dead time for remembering stories ) before returning at home where is my computer and web acess

ceeeps New member
From: uk Registered: 2007-08-26 Posts: 2

Let me just bump this one.

I too spend all my commuting time studying Japanese.  I was considering writing all my stories up into a notebook so that I can read up on them while sitting on the train.  But how good would it be if you could just export them and print them off ?

Amazing site anyway !!  Fast becoming one of my favorite websites !! smile

bluestocking New member
From: Rhode Island Registered: 2007-07-02 Posts: 1

A program called iFlash allows you to make flashcards from the stories and then export them to your iPod.

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

doesn't help with import, but for export I guess you can just spider the site -- maybe if it gets hammered enough we'll get an export function... (just kidding, fabrice!)

ceeeps New member
From: uk Registered: 2007-08-26 Posts: 2

Oh genius !  Why didn't I think of that ?

Got it all into Excel with a looping web query in a couple of minutes.  Thanks smile

simple Member
Registered: 2007-04-09 Posts: 42

Hi

Please can someone help me... T-T

especially ceeeps

I've been trying to download the stories so I can study them on my PDA.  Tried lots of different software but most require some programming skills which I do not have.  The excel way sounds good to me but my HTML sucks so I can't write a decent web query.  Has anyone managed to write a web query or excel.

Thanmks very much

Sam

amthomas Member
From: Japan Registered: 2006-06-22 Posts: 104

Yeah, I second that motion. Share your script, ceeps!

I *could* write my own, but if you've already got one that works...

-ang

Reply #11 - 2008 January 11, 2:49 am
rtkrtk Member
From: Japan Registered: 2007-10-16 Posts: 27

Here is an export script. I've hard-coded a delay of 60 seconds between requests to prevent hammering the server too hard. Don't abuse this script or our beloved site will die under the stress wink

To use it, save the script to a file e.g. export.py, edit the parameters username, password, startingKanji, and endingKanji, and run it with "python export.py". The output is in a comma-separated file "stories.txt" which can probably be imported into any spreadsheet. The file is written incrementally (closed and re-opened) after every kanji story is fetched, so even if the program crashes in the middle of downloading, you should still be able to read all of the stories downloaded so far.

Are there bugs? Probably. Will this script fail if the website changes formatting? Definitely.

Enjoy. Code is public domain.

#!/usr/bin/env python

################## start of user-configurable parameters ######################

username="YOURNAME"
password="YOURPASSWORD"
startingKanji = 205
endingKanji = 210
outputFilename = "stories.txt"
delay=60

################## end of user-configurable parameters #######################

from ClientForm import ParseResponse
from ClientCookie import urlopen
import re
import time

outfile = open(outputFilename,"w")

response = urlopen("http://kanji.koohii.com/login.php")
forms = ParseResponse(response, backwards_compat=False)
form = forms[0]
form["uname"] = username
form["passwd"] = password

urlopen(form.click()).read()
for ikanji in range(205,210):
    kanjiurl="http://kanji.koohii.com/study/?mode=failed&framenum=%d" % (ikanji)
    rawtext = urlopen(kanjiurl).read()

    match_keyword = re.search('(<div class="keyword">)([^<]*)(</div>)',rawtext)
    if(match_keyword):
        g = match_keyword.groups()
        keyword = g[1]

        match_story = re.search('(id="frmStory">)(.*)(</textarea>)',rawtext)
        if(match_story):
            g = match_story.groups()
            story = g[1]
            outstring = '%d,"%s","%s"' % (ikanji, keyword, story)
            outfile.write(outstring+"\n")
            outfile.close()
            outfile = open(outputFilename,"a")
            print outstring

    time.sleep(delay)
outfile.close()

Reply #12 - 2008 January 11, 3:48 am
cangy Member
From: 平安京 Registered: 2006-12-13 Posts: 372 Website

here's mine (by way of encouraging fabrice to add stories to the new export.php!)

Code:

#!/bin/sh

#change this:
cookies="$HOME/.mozilla/firefox/something.something/cookies.txt"

# also, those ^Ms below need to be real ^Ms, not carat-m.  you can probably get one with ^V-return

i=1
while [ "$i" -le 2042 ]
do
  echo -n "$i:"
  wget --load-cookies "$cookies" -O - "http://kanji.koohii.com/study/?framenum=$i" 2>/dev/null | \
    sed ':a; /^M$/N; s/^M\n/ /; ta' | \
    grep '<textarea rows="12" cols="55" name="txtStory" id="frmStory">' | \
    sed 's/.*id="frmStory">\(.*\)<\/textarea>/\1/' | \
    tr : =
  i=`expr "$i" + 1`
done

enjoy!

Last edited by cangy (2008 January 11, 4:09 am)

Reply #13 - 2008 January 11, 6:50 am
xaarg Member
From: Neverland Registered: 2007-07-13 Posts: 160

rtkrtk wrote:

startingKanji = 205
endingKanji = 210
[...]
for ikanji in range(205,210):

That doesn't look right. How is for ikanji in range(startingKanji,endingKanji):?

Reply #14 - 2008 January 11, 9:32 am
misha Member
From: Sydney Registered: 2007-04-05 Posts: 99

Just thought I'd add to the mess and post mine.

Download here:

http://serious-sam.net/stuff/stories.tar.gz

Use it like this:

python koohii_leach.py username password fetch-frames 1 26
python koohii_stories.py stories.txt

Let me know if there are any bugs.

aovora Member
From: Germany Registered: 2007-08-13 Posts: 16

Hello,

could somebody please help me? I tried to run both Python-scripts, but it doesn't work. I figured out, that  I need ClientCookie and ClientForm from this site: http://wwwsearch.sourceforge.net/

But I have no idea how to integrate them. Which files do I have to download? Do I need to import a library?

Thank you very much in advance,

aovora

misha Member
From: Sydney Registered: 2007-04-05 Posts: 99

Download the latest versions from http://wwwsearch.sourceforge.net/ClientCookie/#download and http://wwwsearch.sourceforge.net/ClientForm/#download.  If you're blessed with using Windows, download the .zip files, otherwise, get the .tar.gz files.  Unzip them and read the installation instructions included (usually, they are in README or INSTALL file).

Cheers,
Misha

EDIT: typos

Last edited by misha (2008 March 02, 7:15 am)

Reply #17 - 2008 March 20, 9:26 pm
blackstockc Member
From: Hokkaido, Japan Registered: 2007-08-29 Posts: 59 Website

I`m afraid I`m still not following this.  I`ve downloaded and unzipped both files, but I dont understand how to make them launch the python script.  Could some kind soul post a walkthrough for the layperson?

Reply #18 - 2008 June 24, 1:06 am
brendanmacdonald Member
From: New Zealand Registered: 2007-08-29 Posts: 13

Yes - I would love a more detailed explanation of how to do this. I am not technical at all, sorry!

Any additional details would be a big help, cheers!

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

Here, a Greasemonkey script.

    1. Get Firefox.
    2. Install Greasemonkey.
    3. Install this script.
    4. Go to your stories page
    5. Scroll down. Scroll down...
    6. You'll see a button named "Export stories", hopefully.
    7. Click it!
    8. Wait untill it loads...
    9. There it is. Now do whatever you want with the list.

Reply #20 - 2009 January 25, 5:41 am
HerrPetersen Member
From: Germany Registered: 2007-01-02 Posts: 238

Great script, iSoron!
I have one question/problem though:
There are a couple of hundred Kanji for which I did not enter a story. (Especially large gaps are in the RTK3 section). In a spreadsheet I use to look up Kanji I listed all RTK keywords and I simply want to paste the stories next to them.
So my question is: how can I fill up the missing stories with blank numbered fields?
(i.e.:

transform

174    story 174
175    story 175
176    story 176
178    story 178

to

174    story 174
175    story 175
176    story 176
177   [blank field]
178    story 178
)
Is there maybe even a straightforward method via MSOffice/Open Office?

Last edited by HerrPetersen (2009 January 25, 5:46 am)

this_is_douglas Member
From: Edinburgh - United Kingdom Registered: 2008-04-29 Posts: 17 Website

*little bump* Hi there!  I have tried the Greasemonkey script but it doesn't seem to be working sad I'm using Opera and User-scripts but it's the same principle ... has the coding changed to make it not work, or am I being a n00b? ^_^

Doog

Reply #22 - 2009 April 02, 10:07 am
shinkyu New member
From: japan Registered: 2009-03-31 Posts: 6

Hi  -
I have loaded this script too but it doesnt seem to do anything when I click the "export button" - has something changed or am I missing something?

Any advice much appreciated...

Thanks

SK

Reply #23 - 2009 April 02, 12:05 pm
ファブリス Administrator
From: Belgium Registered: 2006-06-14 Posts: 4021 Website

There ought to be a way to export your stories. I don't want to write this now on the old codebase, so I've put it on the refactoring to-do list as this should be fairly simple to add. The refactored site should be online before the end of April *fingers crossed*.

Reply #24 - 2009 April 02, 12:05 pm
iSoron Member
From: Canada Registered: 2008-03-24 Posts: 490

shinkyu wrote:

I have loaded this script too but it doesnt seem to do anything when I click the "export button" - has something changed or am I missing something?

Still works fine here.
Are there any errors in Firefox error console when you click the button?

this_is_douglas wrote:

I have tried the Greasemonkey script but it doesn't seem to be working sad I'm using Opera and User-scripts but it's the same principle ... has the coding changed to make it not work, or am I being a n00b?

It's possible to create scripts that work both on Firefox and Opera, but I was a bit lazy at the time, and coded it specifically to Firefox. Sorry. I may fix it later. smile

ファブリス wrote:

There ought to be a way to export your stories. I don't want to write this now on the old codebase, so I've put it on the refactoring to-do list as this should be fairly simple to add. The refactored site should be online before the end of April *fingers crossed*.

That would be great.
No more workarounds.

Last edited by iSoron (2009 April 02, 12:08 pm)

Reply #25 - 2009 May 21, 11:38 am
ファブリス Administrator
From: Belgium Registered: 2006-06-14 Posts: 4021 Website

Please see this topic to save your stories for off-line use.

If you have any problems with the export, please post there.

  • 1