Skip to content

Instantly share code, notes, and snippets.

@dahlia
Last active July 1, 2017 16:04
Show Gist options
  • Save dahlia/0c9b43a72de292e2660af940ed4149ec to your computer and use it in GitHub Desktop.
Save dahlia/0c9b43a72de292e2660af940ed4149ec to your computer and use it in GitHub Desktop.
네이버 검색 OSID 표시기

네이버 검색 OSID 표시기

스크린샷

네이버 검색 결과의 상단에 표시되는 인물 정보 등의 섹션에서, 네이버 검색의 온톨로지 엔티티 ID로 추정되는 OSID를 괄호 안에 표시합니다. 엔티티에 대한 모든 링크에 자동으로 적용됩니다.

설치


GreasemonkeyTempermonkey를 통해 사용하시면 됩니다. 사용하는 브라우저에 해당 확장이 없으면 아래 링크에서 확장 먼저 설치해주세요.

// ==UserScript==
// @name Naver Search OSID
// @namespace https://gist.github.com/dahlia/0c9b43a72de292e2660af940ed4149ec
// @description 네이버 검색 OSID 표시기
// @include https://search.naver.com/*
// @include http://search.naver.com/*
// @include http://http://people.search.naver.com/*
// @include https://http://people.search.naver.com/*
// @version 1
// @grant none
// ==/UserScript==
(function () {
document.body.innerHTML += (
'<style>' +
'code.os-display { color: red; )}' +
'code.os-display:before { content: \' (\'; )}' +
'code.os-display:after { content: \') \'; )}' +
'</style>'
);
var links = document.querySelectorAll('a[href*="os="]');
for (var i = 0; i < links.length; ++i) {
var link = links[i], match = link.href.match(/(^|&)os=(\d+)($|&)/);
if (!match) {
continue;
}
var os = match[2], osCode = document.createElement('code');
osCode.className = 'os-display'
osCode.innerText = os;
link.appendChild(osCode);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment