[Seaside] Soup

Cédrick Béler cdrick65 at gmail.com
Tue Dec 8 10:11:49 UTC 2009


Hi,

Lukas solution is far more better. But Soup should work too. Did you pass
the string to translate because
http://translate.google.com/#en|fr|<http://translate.google.com/#en%7Cca%7C>
is
the default url and translation is done by "ajax" on the fly. Otherwise, the
string to translate is encodeed at the end of the url.

For instance, try with
http://translate.google.com/#en|f<http://translate.google.com/#en%7Cca%7C>
r|a%20string%20to%20translate ?

hth,

Cédrick

2009/12/8 AxiNat <tibabenfortlapalanca at gmail.com>

> Hi all!
>
> I'm developing a Seaside app that needs to retrieve a translation from
> google translator, so I thought I'd use Soup.
>
> So i go like:
>
> *aSoup := Soup fromUrl: 'http://translate.google.com/#en|ca|<http://translate.google.com/#en%7Cca%7C>
> '*
>
> but i find that the fetched string is a bit different from the actual
> source code i can see in Mozilla...
>
> *results := aSoup findAllTags: **[:aTag |
> *
> *aTag name = 'span' and:
> *
> *[(aTag attributeAt: 'id') asString beginsWith: 'result_box']].*
>

you can also search for span whose title are each line you want to
translate.



>
> results contains the correct tag, but the tag contains an empty string,
> instead of the translation (it holds the translated string when I check the
> HTML source in firefox)
>
> Any ideas? I find it really awkward, I've worked with soup before and never
> had such problem... so I'm kinda clueless.
>
> Sorry if the question is a bit off-topic (not exactly a Seaside issue...),
> I just guessed that a lot of seasiders sure must have dealt with Soup quite
> a few times :)
>
> Thanks!
>
> Bernat Romagosa.
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>


-- 
Cédrick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20091208/98c89a21/attachment-0001.htm


More information about the seaside mailing list