Skip to content

Instantly share code, notes, and snippets.

@vachzar
Last active September 7, 2015 09:20
Show Gist options
  • Save vachzar/d143c2ba4cd64934f13d to your computer and use it in GitHub Desktop.
Save vachzar/d143c2ba4cd64934f13d to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name mocolebih
// @namespace http://vachzar.com/mocolebih
// @description membaca lebih web-web berita ampas
// @include http://*.tribunnews.com/*
// @version 2
//updateURL1 https://gist.github.com/vachzar/d143c2ba4cd64934f13d/raw/6889bf09034252e6a9a70849dd8f825f4f365e69/MocoLebih.user.js
// @grant none
// @author vachzar
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// allow pasting
// ==/UserScript==
$( document ).ready(function() {
Download('/tribunnews.com/', tribun);
});
function Download(check, callback) {
if (check.test(window.location.host)) {
callback();
controls();
}
}
//
//
var tribun = function () {
var links = [];
var currentPage = 1;
$(document).find('.paging a').each(function () {
links.push($(this).attr('href'));
});
$.each(links, function( index, value ) {
if(index != 0){
var data = $.ajax({url: value, data: {param1: value, param2: value}, async: false}).responseText;
$(data).find('.txt-article').each(function(){
$('.txt-article').append($(this).html());
});
}
});
$('.paging').prev('div').hide();
$('.paging').hide();
$('.txt-article').append( "<p><b>"+links.length+" Pages Loaded by MocoLebih </b></p>" );
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment