i had a error when i parsed JSON.
i am using module of the WebService::Simple to send request to Google Ajax Search API.
try below codes, for example.
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use WebService::Simple;
use WebService::Simple::Parser::JSON;
use Data::Dumper;my $q = 'ケーキ www.bob-an.com/recipe/OutputMain.asp?KeyNo=15711';
my $parser = WebService::Simple::Parser::JSON->new;
$parser->{json}->utf8(1);my $google = WebService::Simple->new(
base_url => 'http://ajax.googleapis.com/ajax/services/search/web',
response_parser => $parser,
params => {
q => $q,
v => '1.0',
rsz => 'large',
lr => 'lang_ja',
},
);my $req = $google->get;
my $res = $req->parse_response;print Dumper($res);
this is the error.
illegal backslash escape sequence in string, at character offset 383 (before "\\\x{30af}\x{30ea}\x{30b9}...") at /usr/lib/perl5/site_perl/5.8.6/WebService/Simple/Parser/JSON.pm line 27.
illegal backslash escape sequence...
if the query changed, it is alright.
my $q = 'www.bob-an.com/recipe/OutputMain.asp?KeyNo=15711';
why? why? why?
it seems bad around '</b>' i guessed.
however i can not solve it.
please, help me.
someday, i wrote a blog post.
it's so long entry.
i wasted about 1 hour and more.
i just finished to write down the entry and push the post button.
but i had an error. it's too bad i edited the post time manually.
i quickly push the back button on browser, however the entry was gone away!
f*ck! i could not get entry back! please, give me my times back!
i was sulky and shutted down my computer and took a bath.
at the time, i had recalled that i hacked my blog system for such time.
all words insert into a clip board when the entry was posted.
i can get my entry back!
i thought so momentarily.
but i can not.
i gave up, and i shutted down my computer certainly.
Of course, clip board data was gone, of course,,,,
i have to hack my computer again to save words into the file instead of the clip board memory.
fmmmmm...