Just released: my utility for people reading 4pda.ru via Babelfish

Discussion in 'Windows Phone' started by Menneisyys, Oct 9, 2007.

Thread Status:
Not open for further replies.
  1. Menneisyys

    Menneisyys Mobile Deity

    Messages:
    2,588
    Likes Received:
    3
    Trophy Points:
    198
    4pda.ru, in addition to XDA-Developers, is one of the best sources of Windows Mobile-related hacking information. It was in there that, for example, I’ve found the hacked, 1023 TAO Midlet Managers, on which, then, Risidoro has built on his latest (1036) TAO releases at XDA-Dev, along with a lot of other info never published in English. Myself not being a businessman traveling in Russia all around or watching / reading / listening to Russian-language literature / music / movies, I would never have thought I would find my knowledge of Russian useful in my professional life – now I have :)

    Should you not know Russian, I’ve created a tool that greatly helps in reading 4pda forums. For this, you will, of course, want to use Babelfish to translate these pages. Just enter the URL (in the case of the MIDlet thread, http://4pda.ru/forum/index.php?showtopic=1333 ) in the Translate a Web page text field, select “Russian to English” in the lower “Select from and to languages” drop-down list and click the bottom Translate button.

    After a while, you&#8217;ll notice that not everything is displayed &#8211; after about 100 kbytes of source HTML, posts are cut and you can&#8217;t make the final part displayed in any way, as can also be seen in THIS screenshot (see the &#8220;<<<<<<<< snip >>>>>>>>&#8221; at the bottom &#8211; it shows Babelfish won&#8217;t translate more).

    The wrong approach you can take in these cases are as follows:
    1. you cut and paste the text in Babelfish in the upper, direct text input field. It&#8217;s a very awkward and slow solution because you can only have some 2-3 kbytes of text translated at one time
    2. save the original Web page to your local PC, edit its HTML source (cut out the first, say, half of the original page) and upload the edited version to any Web server so that it becomes visible to Babelfish. This also involves a lot of additional work.
    Unfortunately, the print mode (clicking the &#8220;&#1042;&#1077;&#1088;&#1089;&#1080;&#1103; &#1076;&#1083;&#1103; &#1087;&#1077;&#1095;&#1072;&#1090;&#1080;&#8221; link, which takes you HERE &#8211; HUGE page!) doesn&#8217;t help much. Much as it (to some degree) cleans up the code and removes the, for most quick translations, unnecessary stuff (avatars, number of posts, links to other pages, ads), it returns the article as one big file, which is, with longer threads, well above 100 kbytes. This means you won&#8217;t see most of the newer posts translated either.

    The right approach, of course, is using my tools ;-). I&#8217;ve created a program that automatically downloads the contents of an entire thread, sliced to small HTML pages named following an easy-to-autogenerate-links-to naming convention. What is more, I also release the source (available HERE) for it so that you can see how it works. You&#8217;re also free to modify it to download other forum content in a much more Bablefish (and, for that matter, also PDA/ mobile) -friendly format.

    Usage

    1. if you haven&#8217;t already done so, install a Java environment on your desktop PC (free JDK download HERE)
    2. download the above-mentioned source file
    3. enter the &#8220;javac ForPDAruSimplifier.java&#8221; command in the same directory (from inside, say, Total Commander) so that the source is compiled
    4. enter the following command:

      java ForPDAruSimplifier 30 1050 1333 "4pda-"

      where the parameters are as follows:
    • 30 is pretty much fixed for 4pda.ru (but different with other sites; this is why I&#8217;ve made it an easily modifiable parameter) &#8211; the number of posts displayed on a forum page
    • 1050 is a product of 30 and 35. 30 is the above-introduced posts-on-a-page parameter; 35 is the number of thread pages. (Now, the MIDlet thread has 35 pages.)
    • 1333 is the number of the thread itself; it can be very easily found. For example, the 1333 for the MIDlet thread can be very easily spotted if you take a look at the URL of the thread: http://4pda.ru/forum/index.php?showtopic=1333. Yes, it&#8217;s the number after &#8220;showtopic=&#8221;.
    • Finally, "4pda-" instructs the tool to save the target files with the &#8220;4pda-&#8220; filename prefix. You can use any other prefix.

    After running the tool, upload the resulting files (in this case, 4pda-01.html &#8230; 4pda-35.html) to the Web so that Babelfish can access it. You can start entering the new addresses into Babelfish. An even better an easier approach is creating a link file, where all you need to do is clicking all the link files in order, with Ctrl (IE) or Ctrl-Shift (Opera) hold down. The latter makes sure the links are opened in a background tab. Just give a try to the following links to see this for yourself: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35. (Downloadable, original source of the above HTML links HERE)

    See the difference? None of the original pages were cut in half and all posts are perfectly readable.

    Note that I&#8217;ve modified the code so that it doesn&#8217;t include local file attachments (my code removes the links). If you know 4pda.ru (or, most Russian PDA sites and their views about international Copyright issues), you know why I&#8217;ve chosen to do so.
     
  2. Menneisyys

    Menneisyys Mobile Deity

    Messages:
    2,588
    Likes Received:
    3
    Trophy Points:
    198
  3. turrumbi1

    turrumbi1 Newbie

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    hi
    i dont seem to be able to get the bootloader to work
    i do the contact+task+reset but i dont know if it is in bootloader mode or not
    i have followed the instructions but with no success
    my ppc just seems to restart in normal mode!
    can you help?
    thanx
    t
     
  4. Menneisyys

    Menneisyys Mobile Deity

    Messages:
    2,588
    Likes Received:
    3
    Trophy Points:
    198
    Are you sure you've posted this into the right thread?
     
Thread Status:
Not open for further replies.

Share This Page