Skip to content

Instantly share code, notes, and snippets.

@fxxkscript
Last active December 18, 2015 13:09
Show Gist options
  • Save fxxkscript/5787985 to your computer and use it in GitHub Desktop.
Save fxxkscript/5787985 to your computer and use it in GitHub Desktop.
微信头像
var obj = {
username: [],
id: []
};
$('tr td .betait-tbtd .val-usr').each(function(index, item) {
var text = $(item).parents('.betait-tbtd').text();
var arr = text.match(/ID\:(\d*)/m);
if (arr && arr.length >= 2) {
var id = arr[1];
var username = item.innerText;
// if (id >=666 && id <= 717) {
obj.username.push(username);
obj.id.push(id);
// }
}
});
var img = 'https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxgeticon?seq=620065326&username=';
$('<div style="position:absolute; left:0; top: 0; z-index: 1000000;" class="ray"></div>').prependTo('body');
for (var i = 0; i < obj.username.length; i++) {
$('<li><span style="color: red;">'+ obj.id[i] + '</span> <img src="' + img + obj.username[i] + '"></li>').appendTo($('.ray'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment