Skip to content

Commit

Permalink
integrating widget, server and masterParser
Browse files Browse the repository at this point in the history
  • Loading branch information
michielbdejong committed Jul 20, 2012
1 parent e4d4a38 commit 4b0f76d
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 533 deletions.
2 changes: 1 addition & 1 deletion dump.json
@@ -1 +1 @@
{"data":{"michielbdejong@identi.ca":{"userAddress":"michielbdejong@identi.ca","name":"Michiel de Jong","avatar":"http://avatar.identi.ca/425878-480-20110427110559.jpeg","from":"index","query":"mic","type":"row"},"unhosted@identi.ca":{"userAddress":"unhosted@identi.ca","name":"Unhosted","avatar":"http://avatar.identi.ca/311670-480-20111003185455.png"},"hugo@identi.ca":{"userAddress":"hugo@identi.ca","name":"Hugo Duncan","avatar":"http://avatar.identi.ca/38-480-20090406041356.jpeg"},"hugor@identi.ca":{"userAddress":"hugor@identi.ca","name":"Hugo","avatar":"http://avatar.identi.ca/308152-256-20101025175420.png"},"hugoroy@identi.ca":{"userAddress":"hugoroy@identi.ca","name":"Hugo Roy","avatar":"http://avatar.identi.ca/58458-154-20111212202527.jpeg","from":"index","query":"hug","type":"row"},"hu@identi.ca":{"userAddress":"hu@identi.ca","name":"Tobias Hunger","avatar":"http://avatar.identi.ca/83630-80-20090928174657.png"},"h@identi.ca":{"userAddress":"h@identi.ca","name":"Helgi Þormar Þorbjörnsson","avatar":"http://avatar.identi.ca/399663-332-20110314152214.jpeg"},"michielb@identi.ca":{"userAddress":"michielb@identi.ca","name":"Michiel Berger","avatar":"http://avatar.identi.ca/19528-original-20080807061920.jpeg"},"michiel@identi.ca":{"userAddress":"michiel@identi.ca","name":"Michiel van Wessem","avatar":"http://avatar3.status.net/i/identica/41615-180-20120517221335.jpeg"},"pete@identi.ca":{"userAddress":"pete@identi.ca","name":"Pete Daniels","avatar":"http://avatar.identi.ca/46004-400-20111204205314.jpeg"},"michielbdejong@twitter.com":{"userAddress":"michielbdejong@twitter.com","name":"Michiel de Jong","avatar":"http://a0.twimg.com/profile_images/2194941545/picresized_th_5a6d23f1e8567cc9ccdac00ace4761c7_normal.jpg","from":"index","query":"mic","type":"row"},"dejong.michiel@facebook.com":{"userAddress":"dejong.michiel@facebook.com","name":"Michiel De Jong","avatar":"http://graph.facebook.com/dejong.michiel/picture","from":"index","query":"mic","type":"row"},"dejong.michiel@gmail.com":{"userAddress":"dejong.michiel@gmail.com","name":"Michiel de Jong","avatar":"http://www.google.com/ig/c/photos/public/AIbEiAIAAABDCLfW7aamnf7XeyILdmNhcmRfcGhvdG8qKGIwYzNhNDg4ZWEwMTg4OWUwOGJmYzViZGU1NTQ0YzY0MWQ2Y2I2YWIwAf39FvvCldqF7AbAvi1Dprjs7_jF","from":"index","query":"mic","type":"row"},"dejongmichiel@gmail.com":{"userAddress":"dejongmichiel@gmail.com","name":"Michiel de Jong","avatar":"http://www.google.com/ig/c/photos/public/AIbEiAIAAABDCLfW7aamnf7XeyILdmNhcmRfcGhvdG8qKGIwYzNhNDg4ZWEwMTg4OWUwOGJmYzViZGU1NTQ0YzY0MWQ2Y2I2YWIwAf39FvvCldqF7AbAvi1Dprjs7_jF"},"dejongmichiel@facebook.com":{"userAddress":"dejongmichiel@facebook.com","name":"Michiel De Jong","avatar":"http://graph.facebook.com/dejongmichiel/picture"}},"index":{"mic":{"dejong.michiel@gmail.com":true,"michielbdejong@twitter.com":true,"michielbdejong@identi.ca":true,"dejongmichiel@gmail.com":true,"dejong.michiel@facebook.com":true,"dejongmichiel@facebook.com":true},"mich":{"dejong.michiel@gmail.com":true,"michielbdejong@twitter.com":true,"michielbdejong@identi.ca":true,"dejongmichiel@gmail.com":true,"dejong.michiel@facebook.com":true,"dejongmichiel@facebook.com":true},"michi":{"dejong.michiel@gmail.com":true,"michielbdejong@twitter.com":true,"michielbdejong@identi.ca":true,"dejongmichiel@gmail.com":true,"dejong.michiel@facebook.com":true,"dejongmichiel@facebook.com":true},"michie":{"dejong.michiel@gmail.com":true,"michielbdejong@twitter.com":true,"michielbdejong@identi.ca":true,"dejongmichiel@gmail.com":true,"dejong.michiel@facebook.com":true,"dejongmichiel@facebook.com":true},"michiel":{"dejong.michiel@gmail.com":true,"michielbdejong@twitter.com":true,"michielbdejong@identi.ca":true,"dejongmichiel@gmail.com":true,"dejong.michiel@facebook.com":true,"dejongmichiel@facebook.com":true},"jon":{"dejong.michiel@gmail.com":true,"michielbdejong@twitter.com":true,"michielbdejong@identi.ca":true,"dejongmichiel@gmail.com":true,"dejong.michiel@facebook.com":true,"dejongmichiel@facebook.com":true},"jong":{"dejong.michiel@gmail.com":true,"michielbdejong@twitter.com":true,"michielbdejong@identi.ca":true,"dejongmichiel@gmail.com":true,"dejong.michiel@facebook.com":true,"dejongmichiel@facebook.com":true},"unh":{"unhosted@identi.ca":true},"unho":{"unhosted@identi.ca":true},"unhos":{"unhosted@identi.ca":true},"unhost":{"unhosted@identi.ca":true},"unhoste":{"unhosted@identi.ca":true},"unhosted":{"unhosted@identi.ca":true},"hug":{"hugoroy@identi.ca":true},"hugo":{"hugoroy@identi.ca":true},"dun":{"hugo@identi.ca":true},"dunc":{"hugo@identi.ca":true},"dunca":{"hugo@identi.ca":true},"duncan":{"hugo@identi.ca":true},"roy":{"hugoroy@identi.ca":true},"tob":{"hu@identi.ca":true},"tobi":{"hu@identi.ca":true},"tobia":{"hu@identi.ca":true},"tobias":{"hu@identi.ca":true},"hun":{"hu@identi.ca":true},"hung":{"hu@identi.ca":true},"hunge":{"hu@identi.ca":true},"hunger":{"hu@identi.ca":true},"hel":{"h@identi.ca":true},"helg":{"h@identi.ca":true},"helgi":{"h@identi.ca":true},"þor":{"h@identi.ca":true},"þorm":{"h@identi.ca":true},"þorma":{"h@identi.ca":true},"þormar":{"h@identi.ca":true},"þorb":{"h@identi.ca":true},"þorbj":{"h@identi.ca":true},"þorbjö":{"h@identi.ca":true},"þorbjör":{"h@identi.ca":true},"þorbjörn":{"h@identi.ca":true},"þorbjörns":{"h@identi.ca":true},"þorbjörnss":{"h@identi.ca":true},"þorbjörnsso":{"h@identi.ca":true},"þorbjörnsson":{"h@identi.ca":true},"ber":{"michielb@identi.ca":true},"berg":{"michielb@identi.ca":true},"berge":{"michielb@identi.ca":true},"berger":{"michielb@identi.ca":true},"van":{"michiel@identi.ca":true},"wes":{"michiel@identi.ca":true},"wess":{"michiel@identi.ca":true},"wesse":{"michiel@identi.ca":true},"wessem":{"michiel@identi.ca":true},"pet":{"pete@identi.ca":true},"pete":{"pete@identi.ca":true},"dan":{"pete@identi.ca":true},"dani":{"pete@identi.ca":true},"danie":{"pete@identi.ca":true},"daniel":{"pete@identi.ca":true},"daniels":{"pete@identi.ca":true}}}
{"data":{"michielbdejong@identi.ca":{"userAddress":"michielbdejong@identi.ca","name":"Michiel de Jong","avatar":"http://avatar.identi.ca/425878-480-20110427110559.jpeg","from":"index","query":"mic","type":"row"},"unhosted@identi.ca":{"userAddress":"unhosted@identi.ca","name":"Unhosted","avatar":"http://avatar.identi.ca/311670-480-20111003185455.png"},"hugo@identi.ca":{"userAddress":"hugo@identi.ca","name":"Hugo Duncan","avatar":"http://avatar.identi.ca/38-480-20090406041356.jpeg"},"hugor@identi.ca":{"userAddress":"hugor@identi.ca","name":"Hugo","avatar":"http://avatar.identi.ca/308152-256-20101025175420.png"},"hugoroy@identi.ca":{"userAddress":"hugoroy@identi.ca","name":"Hugo Roy","avatar":"http://avatar.identi.ca/58458-154-20111212202527.jpeg","from":"index","query":"hug","type":"row"},"hu@identi.ca":{"userAddress":"hu@identi.ca","name":"Tobias Hunger","avatar":"http://avatar.identi.ca/83630-80-20090928174657.png"},"h@identi.ca":{"userAddress":"h@identi.ca","name":"Helgi Þormar Þorbjörnsson","avatar":"http://avatar.identi.ca/399663-332-20110314152214.jpeg"},"michielb@identi.ca":{"userAddress":"michielb@identi.ca","name":"Michiel Berger","avatar":"http://avatar.identi.ca/19528-original-20080807061920.jpeg"},"michiel@identi.ca":{"userAddress":"michiel@identi.ca","name":"Michiel van Wessem","avatar":"http://avatar3.status.net/i/identica/41615-180-20120517221335.jpeg"},"pete@identi.ca":{"userAddress":"pete@identi.ca","name":"Pete Daniels","avatar":"http://avatar.identi.ca/46004-400-20111204205314.jpeg"},"michielbdejong@twitter.com":{"userAddress":"michielbdejong@twitter.com","name":"Michiel de Jong","avatar":"http://a0.twimg.com/profile_images/2194941545/picresized_th_5a6d23f1e8567cc9ccdac00ace4761c7_normal.jpg","from":"index","query":"mic","type":"row"},"dejong.michiel@facebook.com":{"userAddress":"dejong.michiel@facebook.com","name":"Michiel De Jong","avatar":"http://graph.facebook.com/dejong.michiel/picture","from":"index","query":"mic","type":"row"},"dejong.michiel@gmail.com":{"userAddress":"dejong.michiel@gmail.com","name":"Michiel de Jong","avatar":"http://www.google.com/ig/c/photos/public/AIbEiAIAAABDCLfW7aamnf7XeyILdmNhcmRfcGhvdG8qKGIwYzNhNDg4ZWEwMTg4OWUwOGJmYzViZGU1NTQ0YzY0MWQ2Y2I2YWIwAf39FvvCldqF7AbAvi1Dprjs7_jF","from":"index","query":"mic","type":"row"},"dejongmichiel@gmail.com":{"userAddress":"dejongmichiel@gmail.com","name":"Michiel de Jong","avatar":"http://www.google.com/ig/c/photos/public/AIbEiAIAAABDCLfW7aamnf7XeyILdmNhcmRfcGhvdG8qKGIwYzNhNDg4ZWEwMTg4OWUwOGJmYzViZGU1NTQ0YzY0MWQ2Y2I2YWIwAf39FvvCldqF7AbAvi1Dprjs7_jF"},"dejongmichiel@facebook.com":{"userAddress":"dejongmichiel@facebook.com","name":"Michiel De Jong","avatar":"http://graph.facebook.com/dejongmichiel/picture"},"http://identi.ca/michielbdejong/foaf":{"userAddress":"http://identi.ca/michielbdejong/foaf","name":"","avatar":"","type":"row"}},"index":{"mic":{"dejong.michiel@gmail.com":true,"michielbdejong@twitter.com":true,"michielbdejong@identi.ca":true,"dejongmichiel@gmail.com":true,"dejong.michiel@facebook.com":true,"dejongmichiel@facebook.com":true},"mich":{"dejong.michiel@gmail.com":true,"michielbdejong@twitter.com":true,"michielbdejong@identi.ca":true,"dejongmichiel@gmail.com":true,"dejong.michiel@facebook.com":true,"dejongmichiel@facebook.com":true},"michi":{"dejong.michiel@gmail.com":true,"michielbdejong@twitter.com":true,"michielbdejong@identi.ca":true,"dejongmichiel@gmail.com":true,"dejong.michiel@facebook.com":true,"dejongmichiel@facebook.com":true},"michie":{"dejong.michiel@gmail.com":true,"michielbdejong@twitter.com":true,"michielbdejong@identi.ca":true,"dejongmichiel@gmail.com":true,"dejong.michiel@facebook.com":true,"dejongmichiel@facebook.com":true},"michiel":{"dejong.michiel@gmail.com":true,"michielbdejong@twitter.com":true,"michielbdejong@identi.ca":true,"dejongmichiel@gmail.com":true,"dejong.michiel@facebook.com":true,"dejongmichiel@facebook.com":true},"jon":{"dejong.michiel@gmail.com":true,"michielbdejong@twitter.com":true,"michielbdejong@identi.ca":true,"dejongmichiel@gmail.com":true,"dejong.michiel@facebook.com":true,"dejongmichiel@facebook.com":true},"jong":{"dejong.michiel@gmail.com":true,"michielbdejong@twitter.com":true,"michielbdejong@identi.ca":true,"dejongmichiel@gmail.com":true,"dejong.michiel@facebook.com":true,"dejongmichiel@facebook.com":true},"unh":{"unhosted@identi.ca":true},"unho":{"unhosted@identi.ca":true},"unhos":{"unhosted@identi.ca":true},"unhost":{"unhosted@identi.ca":true},"unhoste":{"unhosted@identi.ca":true},"unhosted":{"unhosted@identi.ca":true},"hug":{"hugoroy@identi.ca":true},"hugo":{"hugoroy@identi.ca":true},"dun":{"hugo@identi.ca":true},"dunc":{"hugo@identi.ca":true},"dunca":{"hugo@identi.ca":true},"duncan":{"hugo@identi.ca":true},"roy":{"hugoroy@identi.ca":true},"tob":{"hu@identi.ca":true},"tobi":{"hu@identi.ca":true},"tobia":{"hu@identi.ca":true},"tobias":{"hu@identi.ca":true},"hun":{"hu@identi.ca":true},"hung":{"hu@identi.ca":true},"hunge":{"hu@identi.ca":true},"hunger":{"hu@identi.ca":true},"hel":{"h@identi.ca":true},"helg":{"h@identi.ca":true},"helgi":{"h@identi.ca":true},"þor":{"h@identi.ca":true},"þorm":{"h@identi.ca":true},"þorma":{"h@identi.ca":true},"þormar":{"h@identi.ca":true},"þorb":{"h@identi.ca":true},"þorbj":{"h@identi.ca":true},"þorbjö":{"h@identi.ca":true},"þorbjör":{"h@identi.ca":true},"þorbjörn":{"h@identi.ca":true},"þorbjörns":{"h@identi.ca":true},"þorbjörnss":{"h@identi.ca":true},"þorbjörnsso":{"h@identi.ca":true},"þorbjörnsson":{"h@identi.ca":true},"ber":{"michielb@identi.ca":true},"berg":{"michielb@identi.ca":true},"berge":{"michielb@identi.ca":true},"berger":{"michielb@identi.ca":true},"van":{"michiel@identi.ca":true},"wes":{"michiel@identi.ca":true},"wess":{"michiel@identi.ca":true},"wesse":{"michiel@identi.ca":true},"wessem":{"michiel@identi.ca":true},"pet":{"pete@identi.ca":true},"pete":{"pete@identi.ca":true},"dan":{"pete@identi.ca":true},"dani":{"pete@identi.ca":true},"danie":{"pete@identi.ca":true},"daniel":{"pete@identi.ca":true},"daniels":{"pete@identi.ca":true}}}
70 changes: 70 additions & 0 deletions index.html
@@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script src="sockjs-0.3.min.js">
</script>
<script>
var rows={};
var sock = new SockJS('http://useraddress.net/echo');
sock.onopen = function() {
console.log('open');
};
sock.onmessage = function(e) {
console.log('message', e.data);
var e = JSON.parse(e.data);
if(e.type == 'row') {
addRow(e);
show();
} else if(e.type == 'status') {
showStatus(e.status);
}
};
sock.onclose = function() {
console.log('close');
};
function key() {
sock.send(document.getElementById('in').value);
show();
}
function addRow(data) {
rows[data.userAddress] = data;
}
function matches(row, str) {
if(str.length < 3) {
return;
}
if(str == row.userAddress) {
return row.name;
}
var words = row.name.split(' ');
for(var i=0; i<words.length; i++) {
if(words[i].toLowerCase().substring(0, str.length) == str) {
return words.slice(0, i).join(' ')+'<strong>'+words[i].substring(0, str.length)+'</strong>'+words[i].substring(str.length)+' '+words.slice(i+1).join(' ');
}
}
}
function showStatus(status) {
document.getElementById('spinner').style.display = (status == 'busy' ? 'inline' : 'none');
}
function show() {
var str = '';
for(var i in rows) {
var nameMatch = matches(rows[i], document.getElementById('in').value);
if(nameMatch) {
str += '<li><img src="'+rows[i].avatar+'" style="width:64px;height:64px"> '+nameMatch+' &lt;'+rows[i].userAddress+'&gt;</li>';
}
}
document.getElementById('results').innerHTML = str;
}
</script>
<title>useraddress.net</title>
<meta charset="utf-8">
</head>
<body>
<h3>Search user@facebook.com, user@gmail.com, user@twitter.com, user@identi.ca or any other StatusNet node, or (once primed) free text.</h3>
<h3>Coming soon: user@some-friendica-node and user@some-diaspora-node (everybody's webfinger/foaf/poco syntax choices are slightly different).</h3>
<input onkeyup="key();" id="in">
<span id="spinner" style="display:none"><h2>hmmmmmm...</h2></span>
<ul id="results"></ul>
</body>
</html>

0 comments on commit 4b0f76d

Please sign in to comment.