10
8

More than 5 years have passed since last update.

RebuildfmからDockerに関する回だけを抽出してみた(JavaScriptで)

Last updated at Posted at 2015-03-20

(スクレイピングなので敬称略ですすいません...)

抽出方法

GoogleChromeの JavaScript Consoleでワンライナー書きました。

var baseurl = "http://rebuild.fm"; $('.episode').each(function(i,ep){ var $ep = $(ep);var $a = $ep.find('a'); var path = $a.attr('href'); var excerpt = $ep.find('.excerpt').text(); if(excerpt.match(/docker/i))console.log("* ["+$a.text()+"](" + baseurl + path + ")" ) });

見やすく整形するとこうなります。

var baseurl = "http://rebuild.fm";

$('.episode').each(function(i,ep) {
  var $ep = $(ep);
  var $a = $ep.find('a');
  var path = $a.attr('href');
  var excerpt = $ep.find('.excerpt').text();             
  if (excerpt.match(/docker/i)) {
    console.log("* [" + $a.text() + "](" + baseurl + path + ")");
  }
);
10
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
8