Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var LINK_PATTERNS = [
- [/\b((?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\b/,
- function(g, ck){return['http://www.ip-lookup.net/index.php?'+ck,g]}],
- [/\b([0-9]{17})\b/, function(g, ck){return['http://steamcommunity.com/profiles/'+ck,g]}]
- ];
- function linkify_chunk_for_pat(s, pat, urlg)
- {
- //GM_log('linkifying chunk ' + s.toSource() + ' with ' + pat.toSource());
- var m = pat.exec(s);
- if (m == null) return null;
- info = urlg.apply(null, m);
- var a = sa(make('a', info[1]), 'href', info[0]);
- if((LINK_PATTERNS[0][0]).test(info[1])){
- var flg = sa(make('img'), 'src', 'http://api.hostip.info/flag.php?ip='+info[1]);
- return make('span', flg, a, s.substr(m[0].length));
- }
- return make('span', a, s.substr(m[0].length));
- }
Advertisement
Add Comment
Please, Sign In to add comment