Displays anime/manga series history instead of episode/chapter history, based on RSS feed.
当前为
// ==UserScript==
// @name MyAnimeList (MAL) Alternative History
// @namespace https://gf.qytechs.cn/users/7517
// @description Displays anime/manga series history instead of episode/chapter history, based on RSS feed.
// @version 1.0.3
// @author akarin
// @include /^http\:\/\/myanimelist\.net\/history/
// @grant none
// ==/UserScript==
;(function() {
var FEED_ANIME = 1
var FEED_MANGA = 2
var animeHistory = document.URL.match(/\/anime$/) ? true : false
var mangaHistory = document.URL.match(/\/manga$/) ? true : false
var allHistory = (animeHistory || mangaHistory) ? false : true
var nickname = allHistory ?
document.URL.match(/\/history\/(.+)$/)[1] :
document.URL.match(/\/history\/(.+)(\/anime|\/manga)$/)[1]
var feeds = 0
var feeds_max = allHistory ? 2 : 1
var entries = []
if (allHistory || animeHistory) {
$.get('http://myanimelist.net/rss.php?type=rw&u=' + nickname, function(data) {
process(data, FEED_ANIME)
})
}
if (allHistory || mangaHistory) {
$.get('http://myanimelist.net/rss.php?type=rm&u=' + nickname, function(data) {
process(data, FEED_MANGA)
})
}
function process(data, feedType) {
$('rss > channel > item', data).each(function() {
var entry = {
title: $('title', this).text().match(/^(.+)( - (?!.* - ))/)[1],
type: $('title', this).text().match(/( - (?!.* - ))(.+)$/)[2],
link: $('link', this).text(),
status: $('description', this).text().match(/^(.+) - /)[1],
progress: $('description', this).text().match(/ - (.+)$/)[1],
date: new Date($('pubDate', this).text())
}
if (feedType === FEED_MANGA) {
entry.status = entry.status.replace('Watching', 'Reading')
entry.progress = entry.progress.replace(' chapters', '')
}
else {
entry.progress = entry.progress.replace(' episodes', '')
}
entry.progress = entry.progress.replace(' of ', '/')
entry.progress = entry.progress.replace(/^0\//, '-/')
entry.progress = entry.progress.replace('?', '-')
entries.push(entry)
})
if ((++feeds) < feeds_max) {
return
}
if (entries.length === 0) {
return
}
var $content = $('<div id="new_content" style="padding: 0 15px 10px 15px;"></div>')
$('#horiznav_nav + div').hide().before($content)
var $table = $('<table id="new_history" border="0" cellpadding="0" cellspacing="0"></table>')
$table.append($('<tr></tr>')
.append('<td class="new_header" width="30">#</td>')
.append('<td class="new_header">Title</td>')
.append('<td class="new_header" width="70">Type</td>')
.append('<td class="new_header" width="90">Status</td>')
.append('<td class="new_header" width="70">Progress</td>')
.append('<td class="new_header" width="125">Date</td>')
)
entries.sort(function(a, b) {
return b.date - a.date
})
$.each(entries, function(index, entry) {
var formatDate = entry.date.toLocaleTimeString('en-US', {
year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', hour12: false, minute: '2-digit'
})
$table.append($('<tr></tr>')
.append('<td width="30">' + (index + 1) + '</td>')
.append($('<td></td>').append('<a href="' + entry.link + '">' + entry.title + '</a>'))
.append('<td width="70">' + entry.type + '</td>')
.append('<td width="90">' + entry.status + '</td>')
.append('<td width="70">' + entry.progress + '</td>')
.append('<td width="125">' + formatDate + '</td>')
)
})
$table.css({'min-width': '100%', 'width': '100%'})
$('td', $table).css({'padding': '4px', 'border-bottom': '1px solid #ebebeb', 'text-align': 'center'})
$('td:nth-of-type(2)', $table).css('text-align', 'left')
$('td.new_header', $table).css('font-weight', 'bold')
$table.appendTo($content)
}
})()
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址