-
Notifications
You must be signed in to change notification settings - Fork 0
/
status.user.js
32 lines (31 loc) · 1.12 KB
/
status.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// ==UserScript==
// @name renren_status
// @include http://www.renren.com/*
// @description 人人非好友状态查看
// @version 0.0.1
// @match *://*.renren.com/*
// @grant GM_getValue
// @grant GM_setValue
// @grant unsafeWindow
// @author x1957
// ==/UserScript==
var regex = /www.renren.com\/(\d+)\/profile/;
var url = document.location.href;
if(url.match(regex) != null){
var uid = url.match(regex)[1];
var myid = document.getElementById("showProfileMenu").href.match(/id=(\d+)/)[1];
var openUrl = "http://status.renren.com/status/"+uid;
var atag = document.createElement("a");
var txtNode = document.createTextNode("状态");
atag.setAttribute("href", openUrl);
atag.appendChild(txtNode);
var idiv = document.createElement("div");
idiv.setAttribute("class", "menu-title");
idiv.appendChild(atag);
var odiv = document.createElement("div");
odiv.setAttribute("class" , "menu");
odiv.appendChild(idiv);
var node = document.getElementsByClassName("nav-main")[0];
node.appendChild(odiv);
console.log(openUrl);
}