:help!
結果↓
E478: 慌てないでください!
tipsというよりイースターエッグかな...
scriptencoding utf-8
function! JsonHandler(data)
return a:data
endfunction
function! GetJsonP(url)
let ret = system("curl -s \"" . a:url . "?callback=JsonHandler\"")
let org = &enc
let &enc = "utf-8"
let ret = substitute(ret, '\\u\([0-9a-zA-Z]\{4\}\)', '\=nr2char("0x".submatch(1))', 'g')
exe "let val = " . iconv(ret, "utf-8", org)
let &enc = org
return val
endfunction
function! GetJson(url)
let ret = system("curl -s \"" . a:url . "\"")
let org = &enc
let &enc = "utf-8"
let ret = substitute(ret, '\\u\([0-9a-zA-Z]\{4\}\)', '\=nr2char("0x".submatch(1))', 'g')
exe "let val = " . iconv(ret, "utf-8", org)
let &enc = org
return val
endfunction
if exists("json")
unlet json
endif
if exists("jvar")
unlet jvar
endif
let json = GetJson("http://b.hatena.ne.jp/entry/json/?url=http://mattn.kaoriya.net/web/hatena/20070726110753.htm")
for jvar in json["bookmarks"]
echo jvar["user"] . " - " . jvar["comment"]
endfor
実行結果は以下の通り(参考:はてブでアーーーーッ!!!)
yheld - アーーーーッ!!!フヒヒ、サーセンwwww
parkbench -
ku0522 - アーーッ!!
tyoro1210 - アーーーーッ!!!
mattn - 自分でアーーーーッ!!!
また、del.icio.usの場合は通常のJSONにデフォルトのコールバックが含まれてしまいますので、vimでは解釈出来ません。しかしJSONPならばメソッドを指定する事で左記javascriptが消えてくれます。専用にGetJsonPという関数を用意しました。
if exists("json")
unlet json
endif
if exists("jvar")
unlet jvar
endif
let json = GetJsonP("http://del.icio.us/feeds/json/mattn.jp")
for jvar in json
echo jvar["d"] . " - " . jvar["u"]
endfor
とする事で(参考:mattn.jp in del.icio.us)
FlashVillage.com - FREE Flash Templates - http://www.flashvillage.com/
その対応に意味はあるのか (Yak blog) - http://www.greenspace.info/mt/2007/07/31/post_38.html
Top Rated - Free Stock Photos - http://public-domain-photos.com/
Niconorati (ニコノラティ) - ブログで今話題のニコニコ動画 - http://pulpsite.net/niconorati/
SourceForge、「優秀なオープンメ[スプロジェクト」の投票結果を発・- ZDNet Japan - http://japan.zdnet.com/oss/story/0,3800075264,20353786,00.htm
IT戦記 - style.cssText の使い処に関する考察 - http://d.hatena.ne.jp/amachang/20070730/1185788557
void GraphicWizardsLair( void ); // Ustream.tvの凄いところは、Flashで実用的なIRCクライアントを作っちゃったところ - http://www.otsune.com/diary/2007/07/30/1.html#200707301
カイ氏伝: Wikipediaの「RSSリーダー」がとんでもない件 - http://blogging.from.tv/archives/000564.html
美輪明宏のチンコの有無を返すAPI作った | dzfl::blog - http://dzfl.jp/blog/2007/07/29/miwa-mojo-api/
美輪明宏のチンコの有無を配信するRSS作った - PRESS RELEASE on VOX - http://asada.vox.com/library/post/%E7%BE%8E%E8%BC%AA%E6%98%8E%E5%AE%8F%E3%81%AE%E3%83%81%E3%83%B3%E3%82%B3%E3%81%AE%E6%9C%89%E7%84%A1%E3%82%92%E9%85%8D%E4%BF%A1%E3%81%99%E3%82%8Brss%E4%BD%9C%E3%81%A3%E3%81%9F.html
Cookie Manager | Javascript Code | All Things Webby - http://insin.woaf.net/code/javascript/cookiemanager.html
[N] 無料で使える18のアプリケーション&ウェブサービス - http://netafull.net/lifehack/021313.html
flivpee - Google Code - http://code.google.com/p/flivpee/
MOONGIFT: ≫ オープンメ[スのFlashムービープレーヤ「Flivpee」:オープンメ[スを毎日紹介 - http://www.moongift.jp/2007/07/flivpee/
TechCrunch Japanese アーカイブ ≫ Pownceが、ついにAPIを公開 - http://jp.techcrunch.com/archives/pownce-moving-to-open-api-eventually/
といった結果が得られます。
*** excitetranslate.vim.orig Mon Jul 23 16:30:34 2007
--- excitetranslate.vim Mon Jul 23 16:28:52 2007
***************
*** 4,16 ****
"
" Maintainer: MURAOKA Taro <koron@tka.att.ne.jp>
" Author: Yasuhiro Matsumoto <mattn_jp@hotmail.com>
! " Last Change:25-Dec-2021.
if !exists('g:excitetranslate_options')
let g:excitetranslate_options = 'register,buffer'
endif
! let s:excite_web = 'http://www.excite.co.jp/world/text/'
function! s:CheckEorJ(word)
let all = strlen(a:word)
--- 4,16 ----
"
" Maintainer: MURAOKA Taro <koron@tka.att.ne.jp>
" Author: Yasuhiro Matsumoto <mattn_jp@hotmail.com>
! " Last Change:25-Dec-2021.
if !exists('g:excitetranslate_options')
let g:excitetranslate_options = 'register,buffer'
endif
! let s:excite_web = 'http://www.excite.co.jp/world/english/'
function! s:CheckEorJ(word)
let all = strlen(a:word)
***************
*** 38,43 ****
--- 38,44 ----
silent! %v/^<textarea /d _
silent! %v/name="after"/d _
silent! %s/<[^>]*>//g
+ silent! %s/\r//g
let line = getline(1)
silent bw!
" Remove temporary files
注意)本プラグインを動作させる為には、「Chalice」に含まれる「aliceライブラリ」が必要です。「aliceライブラリ」の最新版は、svnリポジトリから取得出来ます。
:ExciteTranslate
とすれば
これはペンです!
と70年代生まれ小学校2年生レベルの答えが返ってきます。
Kiki's Delivery Service
と戸田奈津子並みの答えが返ってきます。
このブログを応援する