Last active
April 28, 2022 14:26
-
-
Save IwakuraRein/86cea999b33acbedf54da860c7df9db0 to your computer and use it in GitHub Desktop.
Douban2IMDB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 豆瓣页面添加IMDB链接 | |
// @namespace https://github.com/IwakuraRein/ | |
// @version 0.1 | |
// @description 给豆瓣电影的页面添加转到IMDB的链接 | |
// @author Iwakura Rein | |
// @match *://movie.douban.com/subject/* | |
// @icon https://img3.doubanio.com/favicon.ico | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var info = document.getElementById('info').innerHTML; | |
var imdb = info.match('<span class="pl">IMDb:</span> .*?<br')[0]; | |
imdb = imdb.replace('<span class="pl">IMDb:</span> ','').replace('<br',''); | |
var newImdb = '<a href="https://www.imdb.com/title/'+imdb+'/" target="_blank">'+imdb+'</a>'; | |
document.getElementById('info').innerHTML = info.replace(imdb, newImdb); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment