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...
i went to KOCHI in Japan. there is my country. i love KOCHI, and tell you how to stay KOCHI in Japan.
Kochi is famous in the skipjack(KATSUO). it is very very very delicious and no expensive. and any restaurant presents same yumminess. because skipjack had cooked only roast. it so easy. KOCHI's skipjack is special.
you can select flavor sauce(TARE) or salt(SHIO). i recommend you to choice salt flavor. it's good. sauce is good too, but,,, you will feel delicious to eat SHIO skipjack with garlic slice.
KOCHI have other delicious material. fry of moray(UTSUBO), fry of GORI(is little fish in river), TENPURA of green seaweed(AONORI), etc. In any case, KOCHI is delicious.
do not forget to drink SAKE. i recommend you to choice brand of SAKE, TOSADURU or TAKIARASHI.
Come and Enjoy KOCHI. there are many temples like KYOTO.
Tube8.com is exciting video-sharing site, you know.
I guess everybody wants to download awesome videos. But Tube8.com require to register...grrr...
Can I get a video without register?
Yes, we can!
You can get the video of Tube8.com when you use the bookmarklet below.
[ tube8.com video download bookmarklet ]
javascript:p=document.getElementsByTagName('html')[0].innerHTML.match(/var videourl="(http[^"]+\.flv)"/);location.href=RegExp.$1;
Can you use Perl on command line?
Then I recommend to use tube8_fetcher.pl (WWW::Tube8). It's very useful and easy!
See source file, you can see how to use the script.
Download as much as you like!