Skip to content

Instantly share code, notes, and snippets.

@oflow
Created April 14, 2015 09:59
Show Gist options
  • Save oflow/4c4ee08546934631f3be to your computer and use it in GitHub Desktop.
Save oflow/4c4ee08546934631f3be to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name 例のあれ
// @description 見づらいよねー
// @include http://kageki.hankyu.co.jp/news/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// ==/UserScript==
//
(function($) {
var getContent = function(url, elm) {
console.log(url);
$.ajax({
type: 'GET',
url: url,
dataType: 'html'
}).done(function(data) {
var obj = $(data);
var a = obj.find('section.article01 > div');
elm.append('<div class="us_content" />');
elm.find('.us_content').append(a);
}).fail(function(xhr, status) {
console.log(xhr.status, xhr.statusText);
});
}
$('#contents .table04 > .item .body a').each(function() {
if (this.href[0] === '/' || this.href.indexOf('http://kageki.hankyu.co.jp/') != -1) {
getContent(this.href, $(this.parentNode));
}
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment