Skip to content

Instantly share code, notes, and snippets.

@ayberk
Created September 29, 2013 19:57
Show Gist options
  • Save ayberk/6755947 to your computer and use it in GitHub Desktop.
Save ayberk/6755947 to your computer and use it in GitHub Desktop.
eksi sozluk'te en begenilen entryleri okumayi kolaylastiran hede
// ==UserScript==
// @name Eksi Begenilenler
// @namespace 127.0.0.1
// @version 0.1
// @description En begenilenleri ayni sayfada gor
// @match https://eksisozluk.com/istatistik/dunun-en-begenilen-entryleri
// @match https://eksisozluk.com/istatistik/gecen-haftanin-en-begenilen-entryleri
// @match https://eksisozluk.com/istatistik/tsllbnnin-formulu
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
function append(thisItem, url)
{
$.get(url, function(data) {
var x = $(data).find('div.content').html();
thisItem.append("<ol id='entry-list'><li><article data-menu-attached='true'>"
+ "<div id='topic' class='content' itemprop='articleBody text'>"
+ x +"</div>"+"</article></li></ol>");
$('a.b').css({"display":"inline"});
$('a.url').css({"display":"inline"});
$('sup').find('a').css({"display":"inline"});
});
}
$(document).ready(
function()
{
var list = $('#stats');
var items = list.find('li');
var i = 0;
items.each(
function() {
var thisItem = $(this);
var url = $(this).find("a").attr('href');
thisItem.append("<div id='goster' class='options'><a class='button'> Goster/Gizle </a></div>");
var down=0;
thisItem.find('#goster').click(
function()
{
if(down == 1)
{
thisItem.find('#entry-list').css({"display":"none"});
down = 0;
}
else
{
var list = thisItem.find('#entry-list');
if(!list.length)
append(thisItem,url);
thisItem.find('#entry-list').css({"display":"inline-block"});
down = 1;
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment