TEDのトークショーの内容をテキストデータで取得できるという話を聞きましたのでRubyで英文をprintするコードを書いてみました。
URLを叩くとJSONで返してくれるのでparseしてputsするだけでした。
{% gist 2338391 %}
Matt Cutts: Try something new for 30 days という有名なTEDのトークをひとまずdumpしてみました。
$ ./teddump.rb
A few years ago,
I felt like I was stuck in a rut,
so I decided to follow in the footsteps
of the great American philosopher, Morgan Spurlock,
and try something new for 30 days.
The idea is actually pretty simple.
Think about something you've always wanted to add to your life
and try it for the next 30 days.
It turns out,
30 days is just about the right amount of time
できました。
ちなみに、idはページ中のHTMLのdata-idというパラメタから取得しないと分かりません。nokogiriとかでスクレイピングする方法があるようです。
以下を参考にしました。