Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added: Ident javascript library for getting members social profiles

Hooked up a basic version, hover username to see in action
  • Loading branch information...
commit eff2e88b130584fed8e734bd6c906eeb9aac595c 1 parent eb7262e
@tommoor authored
Showing with 1,063 additions and 2 deletions.
  1. +1 −0  .gitignore
  2. +25 −0 background.html
  3. +22 −1 hn.css
  4. BIN  images/icons/12secondstv.png
  5. BIN  images/icons/43people.png
  6. BIN  images/icons/43places.png
  7. BIN  images/icons/43things.png
  8. BIN  images/icons/Thumbs.db
  9. BIN  images/icons/backnetwork.png
  10. BIN  images/icons/backtype.png
  11. BIN  images/icons/barcampbrighton3.png
  12. BIN  images/icons/barcamplondon5.png
  13. BIN  images/icons/blipfm.png
  14. BIN  images/icons/blippr.png
  15. BIN  images/icons/bliptv.png
  16. BIN  images/icons/blogger.png
  17. BIN  images/icons/blogspot.png
  18. BIN  images/icons/brightkite.png
  19. BIN  images/icons/claimid.png
  20. BIN  images/icons/cliqset.png
  21. BIN  images/icons/cocomment.png
  22. BIN  images/icons/corkd.png
  23. BIN  images/icons/dconstruct08.png
  24. BIN  images/icons/delicious.png
  25. BIN  images/icons/digg.png
  26. BIN  images/icons/disqus.png
  27. BIN  images/icons/djangopeople.png
  28. BIN  images/icons/dopplr.png
  29. BIN  images/icons/edenbee.png
  30. BIN  images/icons/emberapp.png
  31. BIN  images/icons/facebook.png
  32. BIN  images/icons/ffffound.png
  33. BIN  images/icons/flickr.png
  34. BIN  images/icons/fotb08.png
  35. BIN  images/icons/fotolog.png
  36. BIN  images/icons/friendfeed.png
  37. BIN  images/icons/getsatisfaction.png
  38. BIN  images/icons/github.png
  39. BIN  images/icons/google.png
  40. BIN  images/icons/googlereader.png
  41. BIN  images/icons/hi5.png
  42. BIN  images/icons/huffduffer.png
  43. BIN  images/icons/icons.png
  44. BIN  images/icons/identica.png
  45. BIN  images/icons/jaiku.png
  46. BIN  images/icons/joost.png
  47. BIN  images/icons/jpg.png
  48. BIN  images/icons/krop.png
  49. BIN  images/icons/lastfm.png
  50. BIN  images/icons/linkedin.png
  51. BIN  images/icons/livejournal.png
  52. BIN  images/icons/madgexlab.png
  53. BIN  images/icons/mashed08.png
  54. BIN  images/icons/meetup.png
  55. BIN  images/icons/microformatsorg.png
  56. BIN  images/icons/mybloglog.png
  57. BIN  images/icons/mynameise.png
  58. BIN  images/icons/myopenid.png
  59. BIN  images/icons/myspace.png
  60. BIN  images/icons/mytvshows.png
  61. BIN  images/icons/netvibes.png
  62. BIN  images/icons/newsvine.png
  63. BIN  images/icons/odeo.png
  64. BIN  images/icons/orkut.png
  65. BIN  images/icons/picasa.png
  66. BIN  images/icons/plaxo.png
  67. BIN  images/icons/plazes.png
  68. BIN  images/icons/plurk.png
  69. BIN  images/icons/pownce.png
  70. BIN  images/icons/profilactic.png
  71. BIN  images/icons/readernaut.png
  72. BIN  images/icons/seesmic.png
  73. BIN  images/icons/slideshare.png
  74. BIN  images/icons/smugmug.png
  75. BIN  images/icons/soup.png
  76. BIN  images/icons/stumbleupon.png
  77. BIN  images/icons/technorati.png
  78. BIN  images/icons/threadless.png
  79. BIN  images/icons/timespeople.png
  80. BIN  images/icons/tumblr.png
  81. BIN  images/icons/twitpic.png
  82. BIN  images/icons/twitter.png
  83. BIN  images/icons/upcoming.png
  84. BIN  images/icons/ustream.png
  85. BIN  images/icons/viddler.png
  86. BIN  images/icons/vimeo.png
  87. BIN  images/icons/vox.png
  88. BIN  images/icons/website.png
  89. BIN  images/icons/windowslive.png
  90. BIN  images/icons/wordpress.png
  91. BIN  images/icons/xing.png
  92. BIN  images/icons/yahoo.png
  93. BIN  images/icons/yelp.png
  94. BIN  images/icons/yiid.png
  95. BIN  images/icons/youtube.png
  96. +104 −0 js/hn.js
  97. +1 −0  js/ident/ident-0.1.min.js
  98. +1 −0  js/ident/ident-content-0.1.min.js
  99. +1 −0  js/ident/ident-profile-0.1.min.js
  100. +1 −0  js/ident/ident-twitter-parser-0.1.min.js
  101. +1 −0  js/ident/ident-ufxtract-parser-0.1.min.js
  102. +1 −0  js/ident/ident-yql-parser-0.1.min.js
  103. +1 −0  js/ident/web-address.min.js
  104. 0  js/{ → libs}/jquery-1.7.1.min.js
  105. +898 −0 js/libs/twitter.text.js
  106. +6 −1 manifest.json
View
1  .gitignore
@@ -0,0 +1 @@
+.DS_Store
View
25 background.html
@@ -0,0 +1,25 @@
+<script src="js/libs/jquery-1.7.1.min.js"></script>
+<script src="js/ident/ident-0.1.min.js"></script>
+<script src="js/ident/ident-profile-0.1.min.js"></script>
+<script src="js/ident/ident-content-0.1.min.js"></script>
+<script src="js/ident/ident-yql-parser-0.1.min.js"></script>
+<script src="js/ident/ident-twitter-parser-0.1.min.js"></script>
+<script src="js/ident/web-address.min.js"></script>
+
+<script>
+ chrome.extension.onConnect.addListener(function(port) {
+
+ port.onMessage.addListener(function(data) {
+ // what to do when we get a response?
+ $(document).bind('ident:update', function(){
+ port.postMessage(ident.identities);
+ });
+
+ // Properties for search
+ ident.useInwardEdges = true;
+ ident.iconPath = "images/icons/";
+ ident.addPrimaryURL = true;
+ ident.search(data.urls.join(','));
+ });
+ });
+</script>
View
23 hn.css
@@ -109,5 +109,26 @@ td.title a:visited {
}
td.subtext {
- display: none;
+ /*display: none;*/
+}
+
+
+/*********** Profile Bubble ***********/
+
+#profile-bubble {
+ background: #fff;
+ border-radius: 4px;
+ border: 1px solid #ccc;
+ padding: 10px;
+ box-shadow: 0 2px 10px rgba(0,0,0,0.1);
+}
+
+#profile-bubble ul {
+ padding: 0;
+ margin: 0;
+ list-style: none;
+}
+
+#profile-bubble ul li span.username {
+ float: right;
}
View
BIN  images/icons/12secondstv.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/43people.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/43places.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/43things.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/Thumbs.db
Binary file not shown
View
BIN  images/icons/backnetwork.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/backtype.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/barcampbrighton3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/barcamplondon5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/blipfm.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/blippr.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/bliptv.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/blogger.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/blogspot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/brightkite.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/claimid.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/cliqset.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/cocomment.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/corkd.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/dconstruct08.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/delicious.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/digg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/disqus.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/djangopeople.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/dopplr.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/edenbee.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/icons/emberapp.png
Diff not rendered
View
BIN  images/icons/facebook.png
Diff not rendered
View
BIN  images/icons/ffffound.png
Diff not rendered
View
BIN  images/icons/flickr.png
Diff not rendered
View
BIN  images/icons/fotb08.png
Diff not rendered
View
BIN  images/icons/fotolog.png
Diff not rendered
View
BIN  images/icons/friendfeed.png
Diff not rendered
View
BIN  images/icons/getsatisfaction.png
Diff not rendered
View
BIN  images/icons/github.png
Diff not rendered
View
BIN  images/icons/google.png
Diff not rendered
View
BIN  images/icons/googlereader.png
Diff not rendered
View
BIN  images/icons/hi5.png
Diff not rendered
View
BIN  images/icons/huffduffer.png
Diff not rendered
View
BIN  images/icons/icons.png
Diff not rendered
View
BIN  images/icons/identica.png
Diff not rendered
View
BIN  images/icons/jaiku.png
Diff not rendered
View
BIN  images/icons/joost.png
Diff not rendered
View
BIN  images/icons/jpg.png
Diff not rendered
View
BIN  images/icons/krop.png
Diff not rendered
View
BIN  images/icons/lastfm.png
Diff not rendered
View
BIN  images/icons/linkedin.png
Diff not rendered
View
BIN  images/icons/livejournal.png
Diff not rendered
View
BIN  images/icons/madgexlab.png
Diff not rendered
View
BIN  images/icons/mashed08.png
Diff not rendered
View
BIN  images/icons/meetup.png
Diff not rendered
View
BIN  images/icons/microformatsorg.png
Diff not rendered
View
BIN  images/icons/mybloglog.png
Diff not rendered
View
BIN  images/icons/mynameise.png
Diff not rendered
View
BIN  images/icons/myopenid.png
Diff not rendered
View
BIN  images/icons/myspace.png
Diff not rendered
View
BIN  images/icons/mytvshows.png
Diff not rendered
View
BIN  images/icons/netvibes.png
Diff not rendered
View
BIN  images/icons/newsvine.png
Diff not rendered
View
BIN  images/icons/odeo.png
Diff not rendered
View
BIN  images/icons/orkut.png
Diff not rendered
View
BIN  images/icons/picasa.png
Diff not rendered
View
BIN  images/icons/plaxo.png
Diff not rendered
View
BIN  images/icons/plazes.png
Diff not rendered
View
BIN  images/icons/plurk.png
Diff not rendered
View
BIN  images/icons/pownce.png
Diff not rendered
View
BIN  images/icons/profilactic.png
Diff not rendered
View
BIN  images/icons/readernaut.png
Diff not rendered
View
BIN  images/icons/seesmic.png
Diff not rendered
View
BIN  images/icons/slideshare.png
Diff not rendered
View
BIN  images/icons/smugmug.png
Diff not rendered
View
BIN  images/icons/soup.png
Diff not rendered
View
BIN  images/icons/stumbleupon.png
Diff not rendered
View
BIN  images/icons/technorati.png
Diff not rendered
View
BIN  images/icons/threadless.png
Diff not rendered
View
BIN  images/icons/timespeople.png
Diff not rendered
View
BIN  images/icons/tumblr.png
Diff not rendered
View
BIN  images/icons/twitpic.png
Diff not rendered
View
BIN  images/icons/twitter.png
Diff not rendered
View
BIN  images/icons/upcoming.png
Diff not rendered
View
BIN  images/icons/ustream.png
Diff not rendered
View
BIN  images/icons/viddler.png
Diff not rendered
View
BIN  images/icons/vimeo.png
Diff not rendered
View
BIN  images/icons/vox.png
Diff not rendered
View
BIN  images/icons/website.png
Diff not rendered
View
BIN  images/icons/windowslive.png
Diff not rendered
View
BIN  images/icons/wordpress.png
Diff not rendered
View
BIN  images/icons/xing.png
Diff not rendered
View
BIN  images/icons/yahoo.png
Diff not rendered
View
BIN  images/icons/yelp.png
Diff not rendered
View
BIN  images/icons/yiid.png
Diff not rendered
View
BIN  images/icons/youtube.png
Diff not rendered
View
104 js/hn.js
@@ -1,12 +1,23 @@
var hn = {
+ loading: [],
+ loaded: [],
+ identport: null,
+ identelem: null,
+
init: function(){
+ hn.createProfileBubble();
hn.createFilterMenu();
hn.parseStories();
hn.bindEvents();
},
+ createProfileBubble: function(){
+
+ $('body').append('<div id="profile-bubble" />');
+ },
+
createFilterMenu: function(){
$('.pagetop').last().append(' | <a class="filters">filters</a> <input id="add-filter" placeholder="Filter stories containing..." type="text" /><ul class="current-filters"></ul>');
@@ -39,6 +50,99 @@ var hn = {
hn.refreshFilters();
}
});
+
+ $('a[href^=user]').live('mouseover', hn.loadUserDetails);
+ $(document).click(hn.closeProfileBubble);
+
+ },
+
+ loadUserDetails: function(){
+
+ var $temp = $('<div/>');
+ var url = $(this).attr('href') + ' table';
+ hn.identelem = $(this);
+ hn.renderProfileBubble();
+
+ // load user profile page into temporary container
+ $temp.load(url, function(){
+
+ // twitter's library is far and away the best for extracting urls
+ var urlsWithIndices = twttr.txt.extractUrlsWithIndices($temp.html());
+ var filtered = [];
+
+ for (var i = 0; i < urlsWithIndices.length; i++) {
+
+ // ensure urls are properly formed
+ if(!urlsWithIndices[i].url.match(/^http:\/\//gi)){
+ urlsWithIndices[i].url = 'http://' + urlsWithIndices[i].url;
+ }
+
+ // filter out any ycombinator that might have got in there
+ if(!urlsWithIndices[i].url.match(/ycombinator/gi)){
+ filtered.push(urlsWithIndices[i].url);
+ }
+ };
+
+ if (filtered.length) {
+ // clean list of profile urls :-)
+ hn.loadUserProfiles(filtered);
+ } else {
+ hn.renderProfileBubble(false);
+ }
+ });
+ },
+
+ loadUserProfiles: function(urls){
+ console.log('Found profile URLS: ' + urls.join(','));
+
+ // stop loading previous profiles
+ // if (hn.identport) hn.identport.disconnect();
+
+ var name = 'ident' + (new Date).getTime();
+ var port = chrome.extension.connect({name: name});
+ port.postMessage({urls: urls});
+ port.onMessage.addListener(hn.renderProfileBubble);
+ hn.identport = port;
+ },
+
+ renderProfileBubble: function(identities){
+
+ // reset bubble
+ $('#profile-bubble').empty();
+
+ if (identities && identities.length > 0){
+ var ul = $('<ul class="profile-list"></ul>').appendTo('#profile-bubble');
+
+ for (var x = 0; x < identities.length; x++) {
+ if (identities[x].name != '') {
+ $('<li><a href="' + identities[x].profileUrl + '"><div class="icon ' + identities[x].spriteClass + '"></div> <span class="icon-label">' + identities[x].name + '</span></a>&nbsp;<span class="username">(' + identities[x].username + ')</span></li>').appendTo(ul);
+ } else {
+ $('<li><a href="' + identities[x].profileUrl + '"><div class="icon ' + identities[x].spriteClass + '"></div> <span class="icon-label">' + identities[x].domain + '</span></a></li>').appendTo(ul);
+ }
+ }
+ } else if (identities === false) {
+ $('#profile-bubble').html('Nothing found :(');
+ } else {
+ $('#profile-bubble').html('Loading...');
+ }
+
+ // position correctly
+ var left = hn.identelem.offset().left + (hn.identelem.width()/2);
+ var width = $('#profile-bubble').width()/2;
+
+ $('#profile-bubble').css({
+ display: 'block',
+ position: 'absolute',
+ top: hn.identelem.offset().top+20,
+ left: left-width
+ })
+ },
+
+ closeProfileBubble: function(ev){
+
+ if (!$(ev.target).parents('#profile-bubble').length && ev.target != $('#profile-bubble')[0]) {
+ $('#profile-bubble').fadeOut(200);
+ }
},
filterStories: function(){
View
1  js/ident/ident-0.1.min.js
@@ -0,0 +1 @@
+ident=new function(){};ident.version="0.1.7";ident.useInwardEdges=true;ident.identities=new Array();ident.domains=new Array();ident.history=new Array();ident.ufParser=null;ident.rssParser=null;ident.atomParser=null;ident.iconPath="ident/icons/";ident.addPrimaryURL=true;ident._startUrl="";ident._apiReturnCount=0;ident._usernames=new Array();ident._primaryCalled=false;ident._secondaryCalled=false;ident._endPoints={sites:[]};ident._endPointsArray=[["12seconds tv","12seconds.tv",[["12seconds.tv/channel/{username}","hCard","Profile","h"],["12seconds.tv/followers/{username}","hCard","Friends","h"],["12seconds.tv/followers/{username}?page={pagenumber}","hCard","Friends","h"],["12seconds.tv/channel/{username}","hAtom","Video","h"]]],["43things","43things.com",[["www.43things.com/person/{username}","None","None","h"],["www.43things.com/rss/uber/author?username={username}","Rss","Activity","r"]]],["43people","43people.com",[["{username}.43people.com/","None","None","h"],["www.43people.com/rss/uber/person?person={username}","Rss","Activity","r"]]],["43places","43places.com",[["{username}.43places.com/","None","None","h"]]],["Backnetwork","backnetwork.com",[]],["Backtype","backtype.com",[["www.backtype.com/{username}/","None","Profile","h"],["feeds.backtype.com/{username}","Rss","Activity","r"]]],["BarCamp Brighton 3","barcampbrighton3.backnetwork.com",[["barcampbrighton3.backnetwork.com/people/person.aspx?personid={username}","hCard","Profile","h"],["barcampbrighton3.backnetwork.com/people/person.aspx?personid={username}","XFN-hCard","Friends","h"]]],["BarCamp London 5","barcamplondon5.backnetwork.com",[["barcamplondon5.backnetwork.com/people/person.aspx?personid={username}","hCard","Profile","h"],["barcamplondon5.backnetwork.com/people/person.aspx?personid={username}","XFN-hCard","Friends","h"]]],["Blip.fm","blip.fm",[["blip.fm/profile/{username}/","None","None","h"],["blip.fm/feed/{username}","Atom","Audio","a"]]],["Blip.tv","blip.tv",[["{username}.blip.tv/","None","Profile","h"]]],["Blippr","blippr.com",[["www.blippr.com/profiles{username}","None","Profile","h"],["www.blippr.com/profiles/{username}/feed.rss","Atom","Activity","a"]]],["BlogSpot","blogspot.com",[]],["Blogger","blogger.com",[["www.blogger.com/profile/{userid}","None","Profile","h"]]],["Brightkite","brightkite.com",[["brightkite.com/people/{username}","hCard","Profile","h"],["brightkite.com/people/{username}/friends?page={pagenumber}","None","Friends","h"],["brightkite.com/people/{username}/objects.rss","Atom","Activity","a"]]],["ClaimId","claimid.com",[["claimid.com/{username}","hCard","Profile","h"]]],["CoComment","cocomment.com",[["www.cocomment.com/comments/{username}","None","None","h"],["www.cocomment.com/webRssUser/{username}.rss","Rss","Activity","r"]]],["Corkd","corkd.com",[["corkd.com/people/{username}","hCard","Profile","h"],["corkd.com/people/{username}/buddies?page={pagenumber}","XFN","Friends","h"]]],["Cliqset","cliqset.com",[["cliqset.com/user/{username}","None","Profile","h"],["cliqset.com/feed/atom?uid={username}","Atom","Activity","a"]]],["d.construct 08","dconstruct08.backnetwork.com",[["dconstruct08.backnetwork.com/people/person.aspx?personid={username}","hCard","Profile","h"],["dconstruct08.backnetwork.com/people/person.aspx?personid={username}","XFN-hCard","Friends","h"]]],["Delicious","del.icio.us",[["feeds.delicious.com/v2/rss/{username}?count=20","Atom","Bookmarks","a"],["del.icio.us/rss/{username}","Rss","Bookmarks","r"],["del.icio.us/{username}#bundle-tags","rel-tag","Interests","h"],["del.icio.us/{username}","None","Profile","h"],["delicious.com/{username}","None","Profile","h"]]],["Digg","digg.com",[["digg.com/users/{username}","hCard","Profile","h"],["digg.com/users/{username}/friends/view/page{pagenumber}","XFN-hCard","Friends","h"]]],["Disqus","disqus.com",[["www.disqus.com/people/{username}/","None","Profile","h"],["www.disqus.com/people/{username}/comments.rss","Rss","Lifestream","r"]]],["Django People","djangopeople.net",[["djangopeople.net/{username}/","hCard","Profile","h"],["djangopeople.net/{username}/","XFN","Services","h"]]],["Dopplr","dopplr.com",[["www.dopplr.com/traveller/{username}","hCard","Profile","h"]]],["Edenbee","edenbee.com",[["www.edenbee.com/users/{username}","hCard","Profile","h"],["www.edenbee.com/users/{username}/relationships?page=(pagenumber}","hCard","Friends","h"],["www.edenbee.com/users/{username}/relationships","hCard","Friends","h"],["edenbee.com/users/{username}","None","None","h"]]],["Emberapp","emberapp.com",[["emberapp.com/{username}","None","Profile","h"],["emberapp.com/{username}/images.rss","None","Images","r"]]],["Facebook","facebook.com",[["www.facebook.com/{username}","hCard","Profile","html"],["www.facebook.com/{username}","XFN","Friends","html"]]],["FFFFound","ffffound.com",[["ffffound.com/home/{username}/found/feed","Rss","Images","r"],["ffffound.com/home/{username}/found/","None","None","h"]]],["Flickr","flickr.com",[["www.flickr.com/people/{username}/","hCard","Profile","h"],["api.flickr.com/services/feeds/photos_public.gne?id={userid}&format=rss_200","Rss","Images","r"],["api.flickr.com/services/feeds/photos_public.gne?id={userid}&format=atom","Atom","Images","a"],["www.flickr.com/photos/{username}/","None","Images","h"],["flickr.com/photos/{username}/","None","Images","h"],["www.flickr.com/people/{username}/contacts/?page={pagenumber}","None","Friends","h"]]],["FOTB 08","fotb08.backnetwork.com",[["fotb08.backnetwork.com/people/person.aspx?personid={username}","hCard","Profile","h"],["fotb08.backnetwork.com/people/person.aspx?personid={username}","XFN-hCard","Friends","h"]]],["Fotolog","fotolog.com",[["www.fotolog.com/{username}","None","Profile","h"]]],["FriendFeed","friendfeed.com",[["friendfeed.com/{username}","hCard","Profile","h"],["friendfeed.com/{username}/services","XFN","Services","h"],["friendfeed.com/{username}?format=atom","Atom","Lifestream","a"]]],["GetSatisfaction","getsatisfaction.com",[["getsatisfaction.com/people/{username}","hCard","Profile","h"],["getsatisfaction.com/people/{username}.rss","Rss","Activity","r"]]],["Github","github.com",[["github.com/{_usernames}/","hCard","Profile","h"],["github.com/{username}.atom","Atom","Activity","a"]]],["Google","google.com",[["www.google.com/profiles/{username}","hCard","Profile","h"],["www.google.com/profiles/{username}","XFN","Services","h"],["www.google.com/profiles/{userid}","XFN","Services","h"],["www.google.com/profiles/{userid}","hCard","Profile","h"]]],["Google Reader","google.com",[["www.google.com/reader/shared/{username}","None","Profile","h"]]],["hi5","hi5.com",[]],["Huffduffer","huffduffer.com",[["huffduffer.com/{username}","hCard","Profile","h"],["huffduffer.com/{username}/rss","Rss","Audio","r"],["huffduffer.com/{username}","hAtom","Audio","h"]]],["Identica","identi.ca",[["identi.ca/{username}","hCard","Profile","h"],["identi.ca/{username}/foaf","FOAF","Profile","Xml"],["identi.ca/{username}/subscriptions?page={pagenumber}","hCard","Friends","h"],["identi.ca/{username}","hAtom","Status","h"],["identi.ca/{username}","rel-tag","Interests","h"],["identi.ca/{username}/all","hAtom","Friends Status","h"]]],["Jaiku","jaiku.com",[["{username}.jaiku.com/","hCard","Profile","h"]]],["JPG","jpgmag.com",[["www.jpgmag.com/people/{username}/photos","hCard","Profile","h"],["www.jpgmag.com/people/{username}/rss","Rss","Images","r"],["www.jpgmag.com/people/{username}/stories/rss","Rss","Entries","r"],["www.jpgmag.com/people/{username}/stories","None","None","h"]]],["Joost","joost.com",[["www.joost.com/users/{username}/","None","Profile","h"],["www.joost.com/api/events/get/{username}?fmt=atom","Atom","Video","a"]]],["krop","krop.com",[["www.krop.com/{username}/resume/","None","Resume","h"],["www.krop.com/{username}/portfolio/","None","Profile","h"]]],["Last.fm","last.fm",[["www.last.fm/user/{username}","hCard","Profile","h"],["www.last.fm/user/{username}/friends?page={pagenumber}","hCard","Friends","h"],["ws.audioscrobbler.com/1.0/user/{username}/recenttracks.rss","Rss","Activity","r"],["www.last.fm/user/{username}","hCalendar","Events","h"],["ws.audioscrobbler.com/1.0/user/{username}/events.rss","Rss","Events","r"]]],["Linked-in","linkedin.com",[["www.linkedin.com/in/{username}","hCard","Profile","h"],["www.linkedin.com/in/{username}","hResume","Resume","h"],["www.linkedin.com/pub/{username}","hCard","Profile","h"],["www.linkedin.com/pub/{username}","hResume","Resume","h"]]],["Livejournal","livejournal.com",[["{username}.livejournal.com/","None","Profile","h"]]],["MadgexLab","ufapi.lab.madgex.com",[["ufapi.lab.madgex.com/profile/{username}","hCard","Profile","h"]]],["Mashed 08","mashed08.backnetwork.com",[["mashed08.backnetwork.com/people/person.aspx?personid={username}","hCard","Profile","h"],["mashed08.backnetwork.com/people/person.aspx?personid={username}","XFN-hCard","Friends","h"]]],["Meetup","meetup.com",[]],["Microformats.org","microformats.org",[["microformats.org/wiki/User:{username}","hCard","Profile",undefined]]],["Mybloglog","mybloglog.com",[["www.mybloglog.com/buzz/members/{username}/hcard","hCard","Profile","h"],["www.mybloglog.com/buzz/members/{username}/","None","None","h"],["www.mybloglog.com/buzz/members/{username}/me/rss.xml","Atom","Lifestream","a"]]],["mytvshows","mytvshows.org",[["www.mytvshows.org/user/{username}/","hCard","Profile","h"],["www.mytvshows.org/rss/user/{username}/","Rss","Activity","r"]]],["My Name is E","mynameise.com",[["www.mynameise.com/{username}","None","Profile","h"],["mynameise.com/{username}","None","Profile","h"],["mynameise.com/{username}","XFN","Services","h"]]],["MyOpenid","myopenid.com",[["{username}.myopenid.com/","None","None","h"]]],["MySpace","myspace.com",[["myspace.com/{username)","hCard","Profile","h"],["www.myspace.com/{username)","hCard","Profile","h"]]],["Netvibes","netvibes.com",[["www.netvibes.com/{username)","hCard","Profile","h"],["www.netvibes.com/{username)/activities?format=atom","Atom","Activity","a"]]],["Newsvine","newsvine.com",[["{username}.newsvine.com/","None","None","h"]]],["Odeo","odeo.com",[["odeo.com/users/{username}","None","None","h"]]],["Orkut","orkut.com",[["www.orkut.com/Profile.aspx?uid={userid}","None","None","h"]]],["Picasa","picasaweb.google.com",[["picasaweb.google.com/{username}","None","Profile","h"],["picasaweb.google.com/data/feed/base/user/{username}?alt=rss&kind=album&hl=en_US&access=public","Rss","Images","r"]]],["Plaxo","plaxo.com",[["{username}.myplaxo.com/","hCard","Profile","h"]]],["Plazes","plazes.com",[["plazes.com/whereis/{username}","hCard","Profile","h"],["plazes.com/whereis/{username}","hCalendar","Events","h"]]],["Plurk","plurk.com",[["www.plurk.com/{username}","None","Profile","h"],["www.plurk.com/{username}.xml","Atom","Events","a"]]],["Profilactic","profilactic.com",[["www.profilactic.com/profile/{username}","None","Profile","h"]]],["Readernaut","readernaut.com",[["readernaut.com/{username}","None","Profile","h"],["readernaut.com/feeds/rss/{username}","Rss","Activity","r"]]],["Seesmic","seesmic.com",[["new.seesmic.com/{username}","hCard","Profile","h"],["feeds.seesmic.com/user.{username}.atom","Atom","Video","a"]]],["Slideshare","slideshare.net",[["www.slideshare.net/rss/user/{username}","Rss","Slides","r"],["www.slideshare.net/{username}","hCard","Profile","h"],["slideshare.net/{username}","None","Profile","h"],["www.slideshare.net/{username}/followers/{pagenumber}","hCard","Friends","h"]]],["Soup.io","soup.io",[["{username}.soup.io/","hCard","Profile","h"],["{username}.soup.io/","XFN","Services","h"],["{username}.soup.io/rss","Rss","Lifestream","r"]]],["Smugmug","smugmug.com",[["{username}.smugmug.com/","None","Profile","h"],["{username}.smugmug.com/hack/feed.mg?Type=nickname&Data={username}&format=atom10","Atom","Photos","a"]]],["Stumbleupon","stumbleupon.com",[["www.stumbleupon.com/stumbler/{username}","None","Profile","h"],["rss.stumbleupon.com/user/{username}/favorites","Rss","Bookmarks","r"]]],["Technorati","technorati.com",[["technorati.com/people/technorati/{username}","hCard","Profile","h"]]],["Threadless","threadless.com",[]],["Times People","timespeople.nytimes.com",[["timespeople.nytimes.com/view/user/{username}/","None","Profile","h"],["timespeople.nytimes.com/view/user/{username}/rss.xml","Rss","Activity","r"]]],["Tumblr","tumblr.com",[["{username}.tumblr.com/","None","None","h"],["{username}.tumblr.com/rss","Rss","Lifestream","r"]]],["Twitter","twitter.com",[["twitter.com/{username}","hCard","Profile","h"],["twitter.com/{username}#people","XFN-hCard","Friends","h"],["twitter.com/{username}","hAtom","Status","h"]]],["Twitpic","twitpic.com",[["www.twitpic.com/photos/{username}","None","Profile","h"],["twitpic.com/photos/{username}/feed.rss","Rss","Photos","r"]]],["Upcoming","upcoming.yahoo.com",[["upcoming.yahoo.com/user/{userid}/","hCard","Profile","h"],["upcoming.yahoo.com/user/{userid}/","hCalendar","Events","h"],["upcoming.yahoo.com/user/{userid}/past/","hCalendar","Events","h"],["upcoming.yahoo.com/syndicate/v2/my_events/{userid}","Rss","Events","r"]]],["Ustream","ustream.tv",[["www.ustream.tv/{username}","None","Profile","h"]]],["Viddler","viddler.com",[["www.viddler.com/explore/{username}","None","Profile","h"],["www.viddler.com/explore/{username}/videos/feed/","Rss","Video","r"]]],["Vimeo","vimeo.com",[["www.vimeo.com/{username}","hCard","Profile","h"],["www.vimeo.com/{username}/contacts/sort:newest/page:{pagenumber}","None","Friends","h"],["vimeo.com/{username}/videos/rss","Atom","Video","a"]]],["Vox","vox.com",[["{username}.vimeo.com/profile/","hCard","Profile","h"]]],["Windows Live","spaces.live.com",[["{username}.spaces.live.com/","None","Profile","h"]]],["Wordpress","wordpress.com",[["{username}.wordpress.com/","None","Profile","h"],["{username}.wordpress.com/feed/atom/","Atom","Lifestream","a"]]],["Xing","xing.com",[["www.xing.com/profile/{username}","hCard","Profile","h"],["www.xing.com/profile/{username}","hResume","Friends","h"]]],["Yahoo","profiles.yahoo.com",[["profiles.yahoo.com/{username}","hCard","Profile","h"]]],["YIID","yiid.com",[["{username}.yiid.com/","hCard","Profile","h"],["{username}.yiid.com/","rel-tag","Interests","h"],["{username}.yiid.com/contacts/{pagenumber}","hCard","Friends","h"],["{username}.yiid.com/identities","XFN","Services","h"],["{username}.yiid.com/cv","hResume","Resume","h"],["{username}.yiid.com/xml/atom_user","Atom","Lifestream","a"]]],["Yelp","yelp.com",[]],["Youtube","youtube.com",[["gdata.youtube.com/feeds/base/users/{username}/uploads?alt=rss&v=2","Atom","Video","a"],["youtube.com/rss/user/{username}/videos.rss","Rss","Video","r"],["youtube.com/user/{username}","None","Profile","h"],["www.youtube.com/profile?user={username}","None","Profile","h"],["www.youtube.com/user/{username}","None","Profile","h"]]]];ident._excludeDomains=["pownce.com","ma.gnolia.com","huff-duff.com","lastfm.com.br","lastfm.com.tr","lastfm.de","lastfm.es","lastfm.fr","lastfm.it","lastfm.jp","lastfm.pl","lastfm.ru","lastfm.se","cn.last.fm","radio.aol.fr"];ident._excludeUrls=["twitter.com/#replies","twitter.com/#inbox","twitter.com/#favorites","twitter.com/following","twitter.com/followers","identi.ca/group","identi.ca/tag","identi.ca/featured","identi.ca/favorited"];ident.profile=function(a,b){this.name="";this.domain="";this.username=new Array();this.profileUrl=b;this.iconUrl="";this.spriteClass=""};ident.domain=function(a,b){this.name="";this.urls=new Array();this.domain=b;this.accounts=new Array();this.hashCard=false;this.hashResume=false};ident.account=function(f,a,b,d,e,c){this.sgn=f;this.verified=a;this.profile=b;this.resume=d;this.ident=e;this.pk=c};ident.historyItem=function(b,a){this.url=b;this.apiurl=a;this.domain="";this.name="";this.contentType="";this.schema="";this.rawJSON=""};ident.username=function(){this.name="";this.rank=0};ident.search=function(b){ident.reset();var d=new Array();if(b.indexOf(",")>-1){d=b.split(",")}else{d[0]=b}for(var a=0;a<=d.length-1;a++){if(a<49){d[a];var c=ident.convertShorthandAddress(d[a]);if(ident.isUrl(c)||ident.isEmail(c)){if(ident.isExcludedUrl(c)==false){ident._startUrl+=c+","}else{ident.error('Sorry web addresses have to represent a person like profile page or a blog i.e. "http://twitter.com/<strong>glennjones</strong>"');ident._startUrl="";break}}else{ident.error('Sorry there seem to be a problem with the format of the web address you entered: "'+b+'"');ident._startUrl="";break}}}ident.apiManager()};ident.apiManager=function(a,b){if(ident._startUrl!=""){if(a!=null){ident.parseSGN(a,b);ident.statusUpdateEvent(["data-change"])}if(ident._primaryCalled==true&&ident._secondaryCalled==true){}if(ident._primaryCalled==true&&ident._secondaryCalled==false){if(ident.useInwardEdges==true){ident._secondaryCalled=true;ident.getSocialGraphData(ident._startUrl,1)}}if(ident._primaryCalled==false){ident._primaryCalled=true;ident.getSocialGraphData(ident._startUrl,0)}}else{ident.error('Sorry web addresses have to represent a person like profile page or a blog i.e. "http://twitter.com/<strong>glennjones</strong>"')}};ident.webFingerManager=function(b,c){ident._apiReturnCount++;if(b!=null){c.rawJSON=b;if(b[0].links){for(var a=0;a<=b[0].links.length-1;a++){if(b[0].links[a].rel=="http://microformats.org/profile/hcard"||b[0].links[a].rel=="http://webfinger.net/rel/profile-page"){ident._startUrl=b[0].links[a].href;ident.apiManager();break}}}}};ident.reset=function(){ident.domains=new Array();ident.history=new Array();ident.profiles=new Array();ident._startUrl="";ident._apiReturnCount=0;ident._primaryCalled=false;ident._secondaryCalled=false;ident._usernames=new Array();ident.resetTrigger()};ident.registerParser=function(a){if((a.parseUf>0&&ident.ufParser==null)||(ident.ufParser!=null&&a.parseUf>ident.ufParser.parseUf)){ident.ufParser=a}if((a.parseRss>0&&ident.rssParser==null)||(ident.rssParser!=null&&a.parseRss>ident.rssParser.parseRss)){ident.rssParser=a}if((a.parseAtom>0&&ident.atomParser==null)||(ident.atomParser!=null&&a.parseAtom>ident.atomParser.parseAtom)){ident.atomParser=a}};ident.getSocialGraphData=function(b,d){var a="http://socialgraph.apis.google.com/lookup?q="+encodeURIComponent(b)+"&fme=1&edo=1&edi="+d+"&sgn=1&pretty=1&jme=1";var c=new ident.historyItem(b,a);c.apiName="googlesoicalgraph";ident.history[ident.history.length]=c;ident.GoogleGraphAPICall(a,c)};ident.parseSGN=function(c,g){ident._apiReturnCount++;if(c!=null){g.rawJSON=c;var b="";for(var f in c.canonical_mapping){b=f}for(var f in c.nodes){if(f.indexOf("sgn://")>-1){var e=c.nodes[f];var d="";var a="";if(e.attributes["profile"]!=null){d=e.attributes["profile"]}if(e.attributes["url"]!=null){a=e.attributes["url"]}ident.appendDomainNode(f,a,true,d);ident.processClaimedNodes(e)}}for(var f in c.nodes){if(f.indexOf("http://")>-1){var e=c.nodes[f];ident.appendDomainNode("",f,false,"");ident.processClaimedNodes(e)}}}ident.postProcessDomainNode()};ident.processClaimedNodes=function(b){if(b.claimed_nodes!=null){for(var a=0;a<=b.claimed_nodes.length-1;a++){var c=b.claimed_nodes[a];if(c.indexOf("sgn://")>-1){ident.appendDomainNode(c,"",true,"")}}for(var a=0;a<=b.claimed_nodes.length-1;a++){var c=b.claimed_nodes[a];if(c.indexOf("http://")>-1){ident.appendDomainNode("",c,true,"")}}}if(b.unverified_claiming_nodes!=null){for(var a=0;a<=b.unverified_claiming_nodes.length-1;a++){var c=b.unverified_claiming_nodes[a];if(c.indexOf("sgn://")>-1){ident.appendDomainNode(c,"",false,"")}}for(var a=0;a<=b.unverified_claiming_nodes.length-1;a++){var c=b.unverified_claiming_nodes[a];if(c.indexOf("http://")>-1){ident.appendDomainNode("",c,false,"")}}}};ident.postProcessDomainNode=function(e,d,a,c){for(var b=0;b<ident.domains.length;b++){ident.appendCustomSGNData(ident.domains[b])}ident.disambiguateNodes();ident.domains.sort(ident.sortByName);ident.buildIdentitiesCollection();ident.statusUpdateEvent(["data-change"])};ident.buildIdentitiesCollection=function(){ident.identities=new Array();ident.disambiguateNodes();if(ident.addPrimaryURL){var e="";if(ident.topDeclaredProfileUrl()){e=ident.topDeclaredProfileUrl()}if(e!=""){var c=ident.parseDomainFromURL(e);var d=false;for(var f=0;f<ident._endPoints.sites.length;f++){if(ident.compareRootDomains(c,ident._endPoints.sites[f].domain)){d=true}}if(!d){var b=new ident.profile();b.name="";b.domain=c;b.iconUrl=ident.iconPath+"website.png";b.spriteClass="icon-website";b.profileUrl=e;ident.identities[ident.identities.length]=b}}}for(var a=0;a<ident.domains.length;a++){if(ident.domains[a].name){ident.domains[a].accounts.sort(ident.sortBySGN);for(var f=0;f<ident.domains[a].accounts.length;f++){var b=new ident.profile();b.username=ident.domains[a].accounts[f].ident;if(ident.domains[a].accounts[f].ident==""){b.username=ident.domains[a].accounts[f].pk}b.name=ident.domains[a].name;b.domain=ident.domains[a].domain;b.iconUrl=ident.iconPath+ident.domains[a].name.replace(/[\-,., ]/g,"").toLowerCase()+".png";b.spriteClass="icon-"+ident.domains[a].name.replace(/[\-,., ]/g,"").toLowerCase();if(ident.domains[a].accounts[f].profile!=""){b.profileUrl=ident.domains[a].accounts[f].profile}else{if(ident.domains[a].urls){b.profileUrl=ident.findUserNameBasedURL(ident.domains[a].urls,b.username)}}if(b.profileUrl!=""&&b.username!=""){ident.identities[ident.identities.length]=b;break}}}}};ident.appendDomainNode=function(f,b,d,c){var g="";if(b.indexOf("http://")==0){g=ident.parseDomainFromURL(b)}if(f!=""){if(f.indexOf("sgn://")==0){g=ident.parseDomainFromSGN(f)}}if(g.length>0){found=null;for(var h=0;h<ident.domains.length;h++){if(ident.compareRootDomains(g,ident.domains[h].domain)){found=ident.domains[h];break}}var a=ident.domainIsExcluded(g);if(g=="mboxsha1"){a=true}if(a==false){if(found==null){var j=new ident.domain("","");j.domain=g.replace("www.","");ident.domains[ident.domains.length]=j;found=j}if(b!=""){ident.appendUrl(found.urls,b)}if(f!=""){var k=new ident.account("","","","","","");k.verified=d;k.profile=c;k.sgn=f;if(k.sgn!=""){var e=new Array();if(k.sgn.indexOf("/?ident=")>-1){e=k.sgn.split("/?ident=");if(e.length==2){ident.appendUsername(e[1]);k.ident=e[1]}}if(k.sgn.indexOf("/?pk=")>-1){e=k.sgn.split("/?pk=");if(e.length==2){k.pk=e[1]}}}ident.appendUniqueIdentityNode(found,k)}}}};ident.disambiguateNodes=function(){for(var c=0;c<ident.domains.length;c++){if(ident.domains[c].accounts.length>1){var b=0;for(var e=0;e<=ident.domains[c].accounts.length-1;e++){if(ident.domains[c].accounts[e].ident!=""){b++}}if(b>1){var d=new Array();var a=ident.topUsername();for(var e=0;e<=ident.domains[c].accounts.length-1;e++){if(ident.domains[c].accounts[e].ident==a){d[d.length]=ident.domains[c].accounts[e]}if(ident.domains[c].accounts[e].pk!=""){d[d.length]=ident.domains[c].accounts[e]}}ident.domains[c].accounts=d}}}};ident.findUserNameBasedURL=function(b,c){for(var a=0;a<b.length;a++){if(b[a].indexOf(c)>-1){return b[a]}}return""};ident.domainNodeContains=function(b){found=false;for(var a=0;a<ident.domains.length;a++){if(ident.compareRootDomains(b,ident.domains[a].domain)){found=true;break}}return found};ident.domainIsExcluded=function(b){var c=false;for(var a=0;a<ident._excludeDomains.length;a++){if(ident.compareRootDomains(b,ident._excludeDomains[a])){c=true;break}}return c};ident.hasAPIBeenCalled=function(b,d,a){var e=false;for(var c=0;c<ident.history.length;c++){if(a!=""){if(ident.history[c].apiurl==a){e=true}}if(b!=""&&d!=""&&ident.history[c].schema!=""){if(ident.history[c].url==b&&ident.history[c].schema.indexOf(d)>-1){e=true}}}return e};ident.sortByName=function(e,d){var c=e.name.toLowerCase();var f=d.name.toLowerCase();return((c<f)?-1:((c>f)?1:0))};ident.sortByDomain=function(e,d){var c=e.domain.toLowerCase();var f=d.domain.toLowerCase();return((c<f)?-1:((c>f)?1:0))};ident.sortBySGN=function(e,d){var c=e.sgn.toLowerCase();var f=d.sgn.toLowerCase();return((c<f)?-1:((c>f)?1:0))};ident.parseUserFromSGN=function(a){var b=a.sgn.substring(6,a.sgn.length);parts=b.split("?");if(parts[1].indexOf("ident=")>-1){a.username=parts[1].replace("ident=","")}else{a.userid=parts[1].replace("pk=","")}};ident.appendUrl=function(d,b){var c=false;for(var a=0;a<=d.length-1;a++){if(d[a]==b){c=true;break}}if(c==false){d[d.length]=b}};ident.appendUsername=function(d){var c=false;for(var a=0;a<=ident._usernames.length-1;a++){if(ident._usernames[a].name==d){c=true;ident._usernames[a].rank++;break}}if(c==false){var b=new ident.username();b.name=d;ident._usernames[ident._usernames.length]=b}};ident.appendCustomSGNData=function(b){for(var a=0;a<=ident._endPoints.sites.length-1;a++){var c=ident._endPoints.sites[a].domain.replace(" ","");if(ident.compareRootDomains(b.domain,c)){b.name=ident._endPoints.sites[a].name;ident.createCustomSGN(b,ident._endPoints.sites[a])}}};ident.createCustomSGN=function(e,i){e.urlmappings=i.urlmappings;for(var g=0;g<=e.urls.length-1;g++){var b=e.urls[g];for(var h=0;h<=i.urlmappings.length-1;h++){var a=i.urlmappings[h];var j=a.urltemplate;if(j!=""&&(j.indexOf("{username}")>-1||j.indexOf("{userid}")>-1)){var c=0;if(j.indexOf("{username}")>-1){c=j.indexOf("{username}")}if(j.indexOf("{userid}")>-1){c=j.indexOf("{userid}")}var d=new Array(2);if(c!=0){d[0]=j.toLowerCase().substring(0,c);if(j.indexOf("{username}")){d[1]=j.toLowerCase().substring(c+10)}else{d[1]=j.toLowerCase().substring(c+8)}}startMatch=false;endMatch=false;user=b;if(b.indexOf(d[0])==0){startMatch=true;part=d[0];user=user.substring(part.length,user.length)}if(d.length==2){if(d[1].length>0){if(ident.endsWith(b,d[1])){endMatch=true;user=user.replace(d[1],"")}else{if(ident.endsWith(b,d[1]+"/")){endMatch=true;user=user.replace(d[1]+"/","")}}}else{endMatch=true}}if(ident.endsWith(user,"/")){user=user.substring(0,user.length-1)}if(user.indexOf("/")>-1){endMatch=false}if(user.indexOf("?")>-1){userParts=user.split("?");user=userParts[0]}if(user.indexOf("#")>-1){userParts=user.split("#");user=userParts[0]}if(startMatch&&endMatch){var f=new ident.account("","","","","","");f.verified=false;f.profile="";if(a.urltemplate.indexOf("{username}")>-1){f.ident=user;ident.appendUsername(user);f.sgn="sgn://"+e.domain+"/?ident="+user}if(a.urltemplate.indexOf("{userid}")>-1){f.pk=user;f.sgn="sgn://"+e.domain+"/?pk="+user}ident.appendProfileData(i.urlmappings,f,b,e);if(ident.domainIsExcluded(e.domain)==false){ident.appendUniqueIdentityNode(e,f)}}}}}for(var g=0;g<=e.accounts.length-1;g++){ident.appendProfileData(i.urlmappings,e.accounts[g],"",e)}};ident.appendUniqueIdentityNode=function(c,a){var b=null;for(var d=0;d<=c.accounts.length-1;d++){if(c.accounts[d].sgn==a.sgn){b=c.accounts[d];break}}if(b==null){c.accounts[c.accounts.length]=a}};ident.appendProfileData=function(d,a,b,c){a.profile=ident.getAPIEndPoint("Profile","hCard",d,a);a.resume=ident.getAPIEndPoint("Resume","hResume",d,a);if(a.profile!=""){c.hashCard=true}if(a.resume!=""){c.hashResume=true}};ident.getAPIEndPoint=function(g,d,c,f,e){var b="";if(c!=undefined){if(c.length){for(var h=0;h<=c.length-1;h++){var a=c[h];if(a.contenttype==g&&a.schema==d){var i=false;b=a.urltemplate;if(f.ident!=""&&b.indexOf("{username}")>-1){b=b.replace("{username}",f.ident);i=true}if(f.pk!=""&&b.indexOf("{userid}")>-1){b=b.replace("{userid}",f.pk);i=true}if(e!=undefined){b=b.replace("{pagenumber}",e)}if(!i){b=""}}if(b!=""){break}}}}return b};ident.topUsername=function(){var b=new ident.username();for(var a=0;a<=ident._usernames.length-1;a++){if(ident._usernames[a].rank>b.rank){b=ident._usernames[a]}}return b.name};ident.isSearching=function(){if(ident._apiReturnCount>=ident.history.length){return false}else{return true}};ident.buildExcludeUrlList=function(){for(var a=0;a<=ident._endPoints.sites.length-1;a++){ident._excludeUrls[ident._excludeUrls.length]=ident._endPoints.sites[a].domain}};ident.buildExcludeUrlList();ident.buildEndPointList=function(){var e=new Array();for(var a=0;a<=ident._endPointsArray.length-1;a++){var c=new Object();c.name=ident._endPointsArray[a][0];c.domain=ident._endPointsArray[a][1];if(c.name=="Google"){c.domain="google.com|profiles"}c.urlmappings=new Array();for(var d=0;d<=ident._endPointsArray[a][2].length-1;d++){var b=new Object();b.urltemplate=ident._endPointsArray[a][2][d][0];b.schema=ident._endPointsArray[a][2][d][1];b.contenttype=ident._endPointsArray[a][2][d][2];b.mediatype=ident._endPointsArray[a][2][d][3];c.urlmappings[c.urlmappings.length]=b;if(b.urltemplate.indexOf("//")==-1){b.urltemplate="http://"+b.urltemplate}switch(b.mediatype){case"h":b.mediatype="Html";break;case"r":b.mediatype="Rss";break;case"a":b.mediatype="Atom";break}}e[e.length]=c}ident._endPoints={sites:e}};ident.buildEndPointList();ident.isExcludedUrl=function(b){for(var a=0;a<=ident._excludeUrls.length-1;a++){if(ident.compareUrl(b,"http://"+ident._excludeUrls[a])){return true}}return false};ident.convertShorthandAddress=function(a){var c="";if(a!=""){a=a.replace("acct:","");a=ident.trim(a," ");var d=new Array();if(ident.isEmail(a)){a=ident.trim(a);var g="http://webfingerclient-dclinton.appspot.com/lookup?identifier="+encodeURIComponent(a)+"&format=json&pretty=true";var i=new ident.historyItem(a,g);i.apiName="webfinger";ident.history[ident.history.length]=i;ident.WebFingerAPICall(g,i)}if(a.match(/\//g)!=null){if(a.match(/\//g).length==1){d=a.split("\\")}}if(a.indexOf(" ")>-1){d=a.split(" ")}if(d.length==2){var f=new Object();var b=ident.trim(d[0].toLowerCase()," ");var e=ident.trim(d[1].toLowerCase()," ");f.ident=e;f.pk=e;for(var h=0;h<=ident._endPoints.sites.length-1;h++){if(b==ident._endPoints.sites[h].domain){c=ident.getAPIEndPoint("Profile","hCard",ident._endPoints.sites[h].urlmappings,f);if(c==""){c=ident.getAPIEndPoint("Profile","None",ident._endPoints.sites[h].urlmappings,f)}}if(b==ident._endPoints.sites[h].name.toLowerCase().replace(/\s/g,"")){if(c==""){c=ident.getAPIEndPoint("Profile","hCard",ident._endPoints.sites[h].urlmappings,f)}if(c==""){c=ident.getAPIEndPoint("Profile","None",ident._endPoints.sites[h].urlmappings,f)}}if(c!=""){break}}}if(c!=""){a=c}}return a};ident.compareRootDomains=function(b,a){var c=false;if(b!=""||a!=""){b=b.toLowerCase().replace("www.","");if(b==a){c=true}}return c};ident.compareUrl=function(b,a){var c=false;if(b.indexOf("#")>-1){b=b.split("#")[0]}if(a.indexOf("#")>-1){a=a.split("#")[0]}if(b!=""||a!=""){b=b.toLowerCase().replace("www.","");a=a.toLowerCase().replace("www.","");if(ident.endsWith(b,"/")==false){b=b+"/"}if(ident.endsWith(a,"/")==false){a=a+"/"}if(b.toLowerCase()==a.toLowerCase()){c=true}}return c};ident.parseDomainFromURL=function(a){var b="";if(a!=undefined&&a!=""){if(a.indexOf("//")>0){var c=a.split("/");b=c[2]}}return b};ident.parseDomainFromSGN=function(c){var a="";c=c.replace("profiles.google.com","google.com|profiles");c=c.substring(6,c.length);var b=c.split("/");if(b[0].length>-1){a=b[0]}return a};ident.endsWith=function(a,c){var b=a.lastIndexOf(c);return(b!=-1)&&(b+c.length==a.length)};ident.isObject=function(a){return(typeof a=="object")};ident.isArray=function(a){if(a.constructor.toString().indexOf("Array")==-1){return false}else{return true}};ident.isString=function(a){return typeof a=="string"};ident.contains=function(d,a){var c=false;for(var b=0;b<d.length;b++){if(d[b]==a){c=true;break}}return c};ident.isUrl=function(a){var b=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return b.test(a)};ident.isEmail=function(a){var b=/^.+\@.+\..+$/;return b.test(a)};ident.tidyString=function(b){var a="";if(ident.isString(b)){if(b!=undefined){if(b!=null){a=ident.trim(b)}else{a=""}}else{a=""}}return a};ident.trim=function(b,a){if(b!=""&&a!=""){return ident.ltrim(ident.rtrim(b,a),a)}else{return""}};ident.ltrim=function(b,a){a=a||"\\s";return b.replace(new RegExp("^["+a+"]+","g"),"")};ident.rtrim=function(b,a){a=a||"\\s";return b.replace(new RegExp("["+a+"]+$","g"),"")};ident.isNullorEmpty=function(a){if(a==null||a==undefined||a==""){return true}else{return false}};ident.getNodeVaue=function(j,g){var c=null;try{var d=g;var k=j.split(".");for(var h=0;h<k.length;h++){if(k[h].indexOf("[")>-1){var b=k[h].split("[");var a=b[0];var e=Number(b[1].substring(0,b[1].length-1));if(d[a]!=null||d[a]!="undefined"){if(d[a][e]!=null||d[a][e]!="undefined"){d=d[a][e]}}else{currentObject=null}}else{if(d[k[h]]!=null||d[k[h]]!="undefined"){d=d[k[h]]}}}c=d}catch(f){c=null}return c};ident.GoogleGraphAPICall=function(a,b){jQuery.getJSON(a+"&callback=?",function(c){ident.apiManager(c,b)})};ident.WebFingerAPICall=function(a,b){jQuery.getJSON(a+"&callback=?",function(c){ident.webFingerManager(c,b)})};ident.resetTrigger=function(){jQuery(document).trigger("ident:reset")};ident.statusUpdateEvent=function(){if(arguments.length>-1){jQuery(document).trigger("ident:update",arguments[0])}else{jQuery(document).trigger("ident:update")}};ident.error=function(){if(arguments.length>-1){jQuery(document).trigger("ident:error",arguments[0])}else{jQuery(document).trigger("ident:error")}ident.reset()};
View
1  js/ident/ident-content-0.1.min.js
@@ -0,0 +1 @@
+ident.entries=new Array();ident.events=new Array();ident.tags=new Array();ident.resetContent=function(){ident.entries=new Array();ident.events=new Array();ident.tags=new Array()};ident.hEntry=function(){this.name="";this.domain="";this.sourceUrl="";this.author=new ident.hCard();this["entry-title"]="";this["entry-content"]=new Array();this["entry-summary"]=new Array();this.bookmark=new ident.enclosure();this.enclosure=new Array();this.published="";this.updated="";this["published-datetime"];this["updated-datetime"];this.tag=new Array()};ident.hAtom=function(){this.domain="";this.sourceUrl="";this.hentry=new Array();this.tag=new Array()};ident.enclosure=function(){this.text="";this.link="";this.type="";this.rel="";this.lenght=""};ident.findContent=function(d,h,c){var a="";var b="";for(var f=0;f<ident.domains.length;f++){if(ident.domains[f].domain==d){if(ident.domains[f].accounts!=null){var e=ident.domains[f];for(var j=0;j<e.accounts.length;j++){var g=e.accounts[j];a=ident.getAPIEndPoint(h,c,e.urlmappings,g,1);if(a!=""){b=e.name;break}}if(a!=""){break}}}}if(b!=""&&a!=""){ident.loadContent(a,d,b,h,c)}};ident.loadContent=function(b,f,a,d,e){var c="microformats";if(e=="Rss"){c="rss"}if(e=="Atom"){c="atom"}if(ident.hasAPIBeenCalled(b,e,"")==false){if(c=="microformats"){ident.ufParser.loadContent(b,f,a,d,e)}if(c=="rss"){ident.rssParser.loadContent(b,f,a,d,e)}if(c=="atom"){ident.atomParser.loadContent(b,f,a,d,e)}}};ident.postProcesshEntry=function(a){if(a["entry-title"]==""){if(a["entry-content"].lenght>-1){a["entry-title"]=a["entry-content"][0]}}if(a.updated==""){a.updated=a.published}if(a.domain=="twitter.com"){a["published-datetime"]=ident.getTwitterDate(a.published);a["updated-datetime"]=ident.getTwitterDate(a.updated)}else{a["published-datetime"]=ident.getJavaScriptDates(a.published);a["updated-datetime"]=ident.getJavaScriptDates(a.updated);a["dtstart-datetime"]=ident.getJavaScriptDates(a.dtstart);a["dtend-datetime"]=ident.getJavaScriptDates(a.dtend)}};ident.postProcesshCalendar=function(a){a["dtstart-datetime"]=ident.getJavaScriptDates(a.dtstart);a["dtend-datetime"]=ident.getJavaScriptDates(a.dtend)};ident.getJavaScriptDates=function(a){var c;if(Date.parse(a)>0){c=new Date(Date.parse(a))}if(c==undefined){var b=new ISODate(a);if(b.dY>-1&&b.dY!=undefined){if(b.tH!=null&&b.tM!=-1&&b.tS!=-1){c=new Date(parseInt(b.dY),parseInt(b.dM-1),parseInt(b.dD),parseInt(b.tH),parseInt(b.tM),parseInt(b.tS))}else{c=new Date(parseInt(b.dY),parseInt(b.dM-1),parseInt(b.dD))}}}return c};ident.getTwitterDate=function(c){var d;if(c.indexOf("minute")>-1||c.indexOf("minutes")>-1||c.indexOf("hour")>-1||c.indexOf("hours")>-1||c.indexOf("day")>-1){number=c.replace("about ","").replace(" hour ago","").replace(" hours ago","").replace(" minutes ago","").replace(" minute ago","");var b=new Date();if(c.indexOf("minute")>-1||c.indexOf("minutes")>-1){b.setTime(b.getTime()-(parseInt(number)*60*1000))}else{b.setTime(b.getTime()-(parseInt(number)*60*60*1000))}d=b}else{var e=c.split(" ");month=1;switch(e[2]){case"Jan":month=0;break;case"Feb":month=1;break;case"Mar":month=2;break;case"Apr":month=3;case"May":month=4;break;case"Jun":month=5;break;case"Jul":month=6;break;case"Aug":month=7;break;case"Sep":month=8;break;case"Oct":month=9;break;case"Nov":month=10;break;case"Dec":month=11;break}var a=e[0].split(":");e[3]=parseInt(e[3].replace("th","").replace("rd","").replace("nd","").replace("st",""));var b=new Date();d=new Date(b.getFullYear(),month,e[3],parseInt(a[0]),parseInt(a[1]),0);if(e[1]=="PM"){d.setTime(d.getTime()+(12*60*60*1000))}d.setTime(d.getTime()+(8*60*60*1000))}return d};function ISODate(){this.dY;this.dM=-1;this.dD=-1;this.z=false;this.tH;this.tM=-1;this.tS=-1;this.tD=-1;this.tzH;this.tzM=-1;this.tzPN="+";this.z=false;this.format="W3C";if(arguments[0]){this.Parse(arguments[0])}}ISODate.prototype.Parse=function(f){var b="",h;var c="",e="",g="";f=f.toUpperCase();if(f.indexOf("T")>-1){h=f.split("T");c=h[0];e=h[1];if(e.indexOf("Z")>-1||e.indexOf("+")>-1||e.indexOf("-")>-1){var d=e.split("Z");e=d[0];g=d[1];this.z=true;if(e.indexOf("+")>-1||e.indexOf("-")>-1){var a=0;if(e.indexOf("+")>-1){a=e.indexOf("+")}else{a=e.indexOf("-")}g=e.substring(a,e.length);e=e.substring(0,a)}}}else{c=f}if(c!=""){this.ParseDate(c);if(e!=""){this.ParseTime(e);if(g!=""){this.ParseTimeZone(g)}}}};ISODate.prototype.ParseDate=function(b){var a="",c;c=b.match(/(\d\d\d\d)?-?(\d\d)?-?(\d\d)?/);if(c[1]){this.dY=c[1]}if(c[2]){this.dM=c[2]}if(c[3]){this.dD=c[3]}};ISODate.prototype.ParseTime=function(a){var b="";var c=a.match(/(\d\d)?:?(\d\d)?:?(\d\d)?.?([0-9]+)?/);timeSegment=a;if(c[1]){this.tH=c[1]}if(c[2]){this.tM=c[2]}if(c[3]){this.tS=c[3]}if(c[4]){this.tD=c[4]}};ISODate.prototype.ParseTimeZone=function(a){var b="";var c=a.match(/([-+]{1})?(\d\d)?:?(\d\d)?/);if(c[1]){this.tzPN=c[1]}if(c[2]){this.tzH=c[2]}if(c[3]){this.tzM=c[3]}};ISODate.prototype.toString=function(){if(this.format=="W3C"){dsep="-";tsep=":"}if(this.format=="RFC3339"){dsep="";tsep=""}var a="";if(typeof(this.dY)!="undefined"){a=this.dY;if(this.dM>0&&this.dM<13){a+=dsep+this.dM;if(this.dD>0&&this.dD<32){a+=dsep+this.dD;if(typeof(this.tH)!="undefined"){if(this.tH>-1&&this.tH<25){a+="T"+this.tH;if(this.tM>-1&&this.tM<61){a+=tsep+this.tM;if(this.tS>-1&&this.tS<61){a+=tsep+this.tS;if(this.tD>-1){a+="."+this.tD}}}if(this.z){a+="Z"}if(typeof(this.tzH)!="undefined"){if(this.tzH>-1&&this.tzH<25){a+=this.tzPN+this.tzH;if(this.tzM>-1&&this.tzM<61){a+=tsep+this.tzM}}}}}}}}return a};ident.contentAddedEvent=function(){ident.statusUpdateEvent(["content-added"])};var doc=jQuery(document);doc.ready(function(){if(ident.ufParser!=null){doc.bind("ident:reset",ident.resetContent)}});
View
1  js/ident/ident-profile-0.1.min.js
@@ -0,0 +1 @@
+ident.combinedProfile;ident.profiles=new Array();ident.resumes=new Array();ident.mes=new Array();ident.xfn=new Array();ident._allProfileUrls=new Array();ident._explicitlyDeclaredProfileUrls=new Array();ident._formattedNames=new Array();ident.formattedName=function(){this.name="";this.rank=0};ident.resetProfiles=function(){ident.combinedProfile=new ident.hCard();ident.profiles=new Array();ident.resumes=new Array();ident.mes=new Array();ident.xfn=new Array();ident._allProfileUrls=new Array();ident._explicitlyDeclaredProfileUrls=new Array();ident._formattedNames=new Array()};ident.name=function(){this.domain="";this.sourceUrl="";this["given-name"]=new Array();this["family-name"]=new Array();this["honorific-prefix"]=new Array()};ident.adr=function(){this.name="";this.domain="";this.sourceUrl="";this.type="";this["street-address"]=new Array();this["extended-address"]=new Array();this.locality="";this.region="";this["postal-code"]="";this["country-name"]="";this["post-office-box"]=""};ident.org=function(){this.domain="";this.sourceUrl="";this["organization-name"]="";this["organization-unit"]=new Array()};ident.hCard=function(){this.domain="";this.sourceUrl="";this.isRepsentative=false;this.fn="";this.n=new ident.name();this.nickname=new Array();this.photo=new Array();this.logo=new Array();this.note=new Array();this.title=new Array();this.role="";this.org=new Array();this.adr=new Array();this.url=new Array();this.email=new Array();this.tel=new Array();this.uid=""};ident.combinedProfile=new ident.hCard();ident.hResume=function(){this.domain="";this.sourceUrl="";this.contact=new ident.hCard();this.summary;this.experience=new Array();this.education=new Array()};ident.hCalendar=function(){this.name="";this.domain="";this.sourceUrl="";this.category=new Array();this.dtend="";this.dtstart="";this.dtstamp="";this.duration="";this["dtend-datetime"]="";this["dtstart-datetime"]="";this["dtstamp-datetime"]="";this["duration-datetime"]="";this.location="";this.status="";this.summary="";this.uid="";this.url="";this["last-modified"]=""};ident.valueTypeProperty=function(){this.domain="";this.sourceUrl="";this.value="";this.type=""};ident.explicitlyDeclaredProfileUrl=function(){this.url="";this.rank=0};ident.combinedProfile=new ident.hCard();ident.rateAddress=function(a){var b=0;if(a!=undefined){if(a["extended-address"]){if(a["extended-address"].length>0){b++}}if(a["street-address"]){if(a["street-address"].length>0){b++}}if(a.locality!=""&&a.locality!=undefined){b++}if(a.region!=""&&a.region!=undefined){b++}if(a["postal-code"]!=""&&a["postal-code"]!=undefined){b++}if(a["country-name"]!=""&&a["country-name"]!=undefined){b++}}return b};ident.createCombinedhCard=function(){var d=ident.combinedProfile=new ident.hCard();for(var a=0;a<=ident.profiles.length-1;a++){var f=ident.profiles[a];var c=ident.profiles[a].domain;var e=ident.profiles[a].sourceUrl;if(f.fn){d.fn=ident.addProperties(d.fn,f.fn,e,c)}if(f.n){if(f.n["given-name"]){if(f.n["given-name"].length){d.n=ident.addPropertiesToObject(d.n,f.n,e,c)}}}if(f.role){d.role=ident.addProperties(d.role,f.role,e,c)}if(f.nickname){if(d.nickname.length){f.nickname[0]=ident.addProperties(d.nickname[0],f.nickname[0],e,c)}}if(f.title){if(f.title.length){if(f.domain!="linkedin.com"){d.title[0]=ident.addProperties(d.title[0],f.title[0],e,c)}}}if(f.org){if(f.org.length){d.org[0]=ident.addPropertiesToObject(d.org[0],f.org[0],e,c)}}if(f.photo){if(f.photo.length){if(d.photo[0]==undefined){d.photo[0]=ident.addProperties(d.photo[0],f.photo[0],e,c)}}}if(f.logo){if(f.logo.length){if(d.logo[0]==undefined){d.logo[0]=ident.addProperties(d.logo[0],f.logo[0],e,c)}}}if(f.note){if(f.note.length){if(d.note[0]==undefined){d.note[0]=ident.addProperties(d.note[0],f.note[0],e,c)}else{if(f.note[0].length>d.note[0].length){d.note[0]=ident.addProperties(d.note[0],f.note[0],e,c)}}}}if(f.adr){var b=0;if(d.adr.length>0){b=ident.rateAddress(d.adr[0])}if(ident.rateAddress(f.adr[0])>b){d.adr[0]=ident.addPropertiesToObject(d.adr[0],f.adr[0],e,c)}}if(f.url){for(var g=0;g<=f.url.length-1;g++){if(f.url[g].indexOf("http://")>-1){if(ident.containsValue(d.url,f.url[g])==false&&ident.containsValue(d.url,f.url[g]+"/")==false){d.url[d.url.length++]=ident.addProperties(null,f.url[g],e,c)}}}}if(f.email){for(var g=0;g<=f.email.length-1;g++){if(f.email[g].value!=undefined){if(f.email[g].value.indexOf("@")>-1){if(ident.containsValue(d.email,f.email[g].value)==false){d.email[d.email.length++]=ident.addPropertiesToObject(null,f.email[g],e,c)}}}}}if(f.tel){for(var g=0;g<=f.tel.length-1;g++){if(ident.containsValue(d.tel,f.tel[g].value)==false){if(f.tel[g].type){if(f.tel[g].type[0]=="work VOICE"){f.tel[g].type[0]="work"}}d.tel[d.tel.length++]=ident.addPropertiesToObject(null,f.tel[g],e,c)}}}}for(var a=0;a<=ident.profiles.length-1;a++){var f=ident.profiles[a];var c=ident.profiles[a].domain;var e=ident.profiles[a].sourceUrl;if(c="twitter.com"){if(f.note){if(f.note.length){d.note[0]=ident.addProperties(d.note[0],f.note[0],e,c)}}break}}for(var a=0;a<=ident.profiles.length-1;a++){var f=ident.profiles[a];var c=ident.profiles[a].domain;var e=ident.profiles[a].sourceUrl;if(c=="linkedin.com"){if(f.photo){if(f.photo.length){d.photo[0]=ident.addProperties(d.photo[0],f.photo[0],e,c)}}if(f.note){if(f.note.length){d.note[0]=ident.addProperties(d.note[0],f.note[0],e,c)}}break}}};ident.addProperties=function(b,e,d,a){if(b!=undefined||b!=null){if(b.value){if(e.length>b.value.length){b.value=e;b.sourceUrl=d;b.domain=a;return b}else{return b}}else{var c=new Object();c.value=e;c.sourceUrl=d;c.domain=a;return c}}else{var c=new Object();c.value=e;c.sourceUrl=d;c.domain=a;return c}};ident.addPropertiesToObject=function(b,e,d,a){if(e!=undefined){var c=e;c.sourceUrl=d;c.domain=a;return c}else{return null}};ident.sentenceTruncate=function(e,c){var a=e;if(e!=undefined){if(e!=null){if(e!=""){if(e.indexOf(".")>-1){a="";var d=e.split(". ");for(var b=0;b<=d.length-1;b++){if(b<c){a+=d[b]+". "}}}}}}return a};ident.appendAllProfileUrls=function(b){var c=false;for(var a=0;a<=ident._allProfileUrls.length-1;a++){if(ident.compareUrl(ident._allProfileUrls[a],b)){c=true;break}}if(c==false){ident._allProfileUrls[ident._allProfileUrls.length]=b}};ident.appendDeclaredProfileUrl=function(b){var c=false;for(var a=0;a<=ident._explicitlyDeclaredProfileUrls.length-1;a++){if(ident._explicitlyDeclaredProfileUrls[a].url==b){c=true;ident._explicitlyDeclaredProfileUrls[a].rank++;break}}if(c==false){var d=new ident.explicitlyDeclaredProfileUrl();d.url=b;ident._explicitlyDeclaredProfileUrls[ident._explicitlyDeclaredProfileUrls.length]=d}};ident.topDeclaredProfileUrl=function(){var b=new ident.explicitlyDeclaredProfileUrl();if(ident._explicitlyDeclaredProfileUrls.length>0){b=ident._explicitlyDeclaredProfileUrls[0]}for(var a=0;a<=ident._explicitlyDeclaredProfileUrls.length-1;a++){if(ident._explicitlyDeclaredProfileUrls[a].rank>b.rank){b=ident._explicitlyDeclaredProfileUrls[a]}}return b.url};ident.topFormattedName=function(){var b=new ident.formattedName();for(var a=0;a<=ident._formattedNames.length-1;a++){if(ident._formattedNames[a].rank>b.rank){b=ident._formattedNames[a]}}return b.name};ident.appendFormattedName=function(b){var c=false;if(b!=""){for(var a=0;a<=ident._formattedNames.length-1;a++){if(ident._formattedNames[a].name.toLowerCase()==b.toLowerCase()){ident._formattedNames[a].rank++;c=true;break}}if(c==false){var d=new ident.formattedName();d.name=b.replace(" "," ");ident._formattedNames[ident._formattedNames.length]=d}}};ident.containsMe=function(b){var c=false;if(b!=""){if(b.indexOf(" ")>-1){parts=b.split(" ");for(var a=0;a<parts.length;a++){if(parts[a].toLowerCase()=="me"){c=true}}}else{if(b.toLowerCase()=="me"){c=true}}}return c};ident.findRepresentativehCard=function(e,a){var j=null;var g=new Array();for(var f=0;f<e.length;f++){if(e[f].fn!=e[f].org){g[g.length]=e[f]}}e=g;if(e.length==1){j=e[0]}else{if(j==null){var h=ident.topDeclaredProfileUrl();for(var f=0;f<e.length;f++){if(e[f].url){for(var d=0;d<e[f].url.length;d++){for(var b=0;b<ident._allProfileUrls.length;b++){if(ident.compareUrl(e[f].url[d],ident._allProfileUrls[b])){j=e[f];break}}}}}}if(j==null){var c=ident.topFormattedName();for(var f=0;f<e.length;f++){if(e[f].fn){if(e[f].fn.replace(" "," ")==c.replace(" "," ")){j=e[f];break}}}}if(j==null){for(var f=0;f<ident.resumes.length;f++){if(ident.resumes[f].domain==a){if(ident.resumes[f].contact){j=hident.resumes[b].contact}if(ident.resumes[f].summary!=""){j.note[0]=ident.resumes[f].summary}}}}}return j};ident.containsValue=function(c,a){found=false;for(var b=0;b<c.length;b++){if(c[b].value==a){found=true;break}}return found};var doc=jQuery(document);doc.ready(function(){if(ident.ufParser!=null){doc.bind("ident:update",ident.ufParser.findProfiles);doc.bind("ident:reset",ident.resetProfiles)}});ident.profileAddedEvent=function(){ident.statusUpdateEvent(["profile-added"])};
View
1  js/ident/ident-twitter-parser-0.1.min.js
@@ -0,0 +1 @@
+ident.getEnchancedTwitterProfile=function(c,b){var d=new ident.historyItem(c,"");d.apiName=b;d.name="Twitter";d.domain="twitter.com";d.schema="hCard";d.contentType="Profile";var e="";if(c.indexOf("/")>-1){parts=c.split("/");e=parts[parts.length-1]}var a="http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20twitter.user.profile%20where%20id%3D%27"+e+"%27&format=json&env=http%3A%2F%2Fdatatables.org%2Falltables.env";d.apiurl=a;ident.history[ident.history.length]=d;jQuery.getJSON(a+"&callback=?",function(f){ident.processEnchancedTwitterJson(f,d,c)})};ident.processEnchancedTwitterJson=function(json,historyItem,url){ident._apiReturnCount++;if(ident.isObject(json)){yql=json}else{yql=eval("("+json+")")}historyItem.rawJSON=yql;var sourceUrl="";var hcard=new ident.hCard();hcard.sourceUrl=url;hcard.domain="twitter.com";hcard.name="Twitter";if(yql!=null){if(yql.query!=null){if(yql.query.results!=null){if(yql.query.results.item!=null){if(yql.query.results.item.item!=null){if(yql.query.results.item.item.length!=null){for(var j=0;j<=yql.query.results.item.item.length-1;j++){if(yql.query.results.item.item[j].rel){if(yql.query.results.item.item[j].rel=="rel:Photo"){hcard.photo[0]=yql.query.results.item.item[j].resource}}}}}if(yql.query.results.item.meta!=null){if(yql.query.results.item.meta.length!=null){for(var j=0;j<=yql.query.results.item.meta.length-1;j++){if(yql.query.results.item.meta[j].property){if(yql.query.results.item.meta[j].property=="foaf:name"){hcard.fn=yql.query.results.item.meta[j].content}if(yql.query.results.item.meta[j].property=="foaf:nick"){hcard.nickname=yql.query.results.item.meta[j].content}if(yql.query.results.item.meta[j].property=="foaf:homepage"){hcard.url[0]=yql.query.results.item.meta[j].content}if(yql.query.results.item.meta[j].property=="dc:description"){if(yql.query.results.item.meta[j].content!=undefined){hcard.note[0]=yql.query.results.item.meta[j].content}}if(yql.query.results.item.meta[j].property=="geo:location"){var adr=new ident.adr();adr.locality=yql.query.results.item.meta[j].content;hcard.adr[0]=adr}}}}}}}}}ident.profiles[ident.profiles.length++]=hcard;ident.createCombinedhCard();ident.profileAddedEvent()};
View
1  js/ident/ident-ufxtract-parser-0.1.min.js
@@ -0,0 +1 @@
+ident.ufxtract={parserName:"ufxtract",parseUf:10,parseRss:0,parseAtom:0,findProfiles:function(){ident.ufxtract.findContent("twitter.com","Profile","hCard",true);for(var a=0;a<ident.domains.length;a++){if(ident.domains[a].accounts!=null){ident.ufxtract.findContent(ident.domains[a].domain,"Profile","hCard",true);ident.ufxtract.findContent(ident.domains[a].domain,"Resume","hResume",true);ident.ufxtract.findContent(ident.domains[a].domain,"Services","XFN",true)}}},findContent:function(d,j,c,h){var a="";var b="";for(var f=0;f<ident.domains.length;f++){if(ident.domains[f].domain==d){if(ident.domains[f].accounts!=null){var e=ident.domains[f];for(var k=0;k<e.accounts.length;k++){var g=e.accounts[k];var a=ident.getAPIEndPoint(j,c,e.urlmappings,g,1);if(a!=""){b=e.name;break}}}}}if(b!=""&&a!=""){if(h==true){if(ident.hasAPIBeenCalled(a,c,"")==false){ident.ufxtract.loadContent(a,d,b,j,c)}}else{ident.ufxtract.loadContent(a,d,b,j,c)}}},loadContent:function(b,e,a,c,d){if(ident.hasAPIBeenCalled(b,d,"")==false){ident.ufxtract._getJson(b,e,a,c,d)}},_getJson:function(b,e,a,c,d){if(d=="rel-tag"){d="tag"}apiurl="http://ufxtract.com/api/?url="+encodeURIComponent(b)+"&format="+d+"&output=json";var f=new ident.historyItem(b,apiurl);f.apiName="ufxtract";f.name=a;f.domain=e;f.schema=d;f.contentType=c;ident.appendAllProfileUrls(b);if(e=="twitter.com"&&ident.getEnchancedTwitterProfile&&d=="hCard"){ident.getEnchancedTwitterProfile(b,"ufxtract")}else{ident.history[ident.history.length]=f;ident.ufxtract._UfXtractAPICall(b,f)}},_parseUfData:function(f,a,d){if(ident.hasAPIBeenCalled(a,d.schema,"")){ident._apiReturnCount++;d.rawJSON=f;ident.ufxtract._processUfJson(f,a,d.domain,d.name,d.contentType);if(d.schema=="hCard"){for(var b=0;b<ident.history.length;b++){var c=false;for(var e=0;e<ident.profiles.length;e++){if(ident.history[b].domain==ident.profiles[e].domain){c=true}}if(c==false){ident.ufxtract._processUfJson(ident.history[b].rawJSON,ident.history[b].url,ident.history[b].domain,ident.history[b].name,ident.history[b].contentType)}}}}},_processUfJson:function(h,b,f,a,d){if(h.microformats){h=h.microformats;if(h.hentry){if(h.hentry.length>0){for(var c=0;c<h.hentry.length;c++){h.hentry[c].sourceUrl=b;h.hentry[c].domain=f;h.hentry[c].name=a;h.hentry[c].type=d;ident.postProcesshEntry(h.hentry[c]);ident.entries[ident.entries.length]=h.hentry[c]}}ident.contentAddedEvent()}if(h.vevent){if(h.vevent.length>0){for(var c=0;c<h.vevent.length;c++){h.vevent[c].sourceUrl=b;h.vevent[c].domain=f;h.vevent[c].name=a;h.vevent[c].type=d;ident.postProcesshCalendar(h.vevent[c]);ident.events[ident.events.length]=h.vevent[c]}}ident.contentAddedEvent()}if(h.tag){if(h.tag.length>0){for(var c=0;c<h.tag.length;c++){h.tag[c].sourceUrl=b;h.tag[c].domain=f;h.tag[c].name=a;h.tag[c].type=d;parts=h.tag[c].tag.split(";_");if(parts.length>1){h.tag[c].tag=parts[0]}ident.tags[ident.tags.length]=h.tag[c]}}ident.contentAddedEvent()}if(h.vcard){if(h.vcard.length>0){var g=ident.findRepresentativehCard(h.vcard,f);if(g!=null){g.sourceUrl=b;g.domain=f;g.name=a;if(g.url){for(var c=0;c<g.url.length;c++){ident.appendDeclaredProfileUrl(g.url[c]);ident.appendDomainNode("",g.url[c],false,"");ident.appendAllProfileUrls(g.url[c])}ident.postProcessDomainNode()}if(g.logo){if(ident.isString(g.logo)==false){g.logo=""}}if(g.logo){if(ident.isString(g.logo)==false){g.logo=""}}if(g.fn){ident.appendFormattedName(g.fn.replace(" "," "))}if(g.fn!=""){ident.profiles[ident.profiles.length]=g}}}ident.createCombinedhCard();ident.profileAddedEvent()}if(h.xfn){if(h.xfn.length){for(var c=0;c<h.xfn.length;c++){h.xfn[c].sourceUrl=b;h.xfn[c].domain=f;h.xfn[c].name=a;h.xfn[c].type=d;ident.xfn[ident.xfn.length]=h.xfn[c];if(ident.containsMe(h.xfn[c].rel)){ident.mes[ident.mes.length]=h.xfn[c];ident.appendDeclaredProfileUrl(h.xfn[c].link);ident.appendDomainNode("",h.xfn[c].link,false,"");ident.appendAllProfileUrls(h.xfn[c].link)}}ident.postProcessDomainNode()}}if(h.hresume){var e=false;for(var c=0;c<ident.profiles.length;c++){if(ident.profiles[c].domain==f){e=true;ident.profiles[c].note=new Array();if(h.hresume[0].summary!=undefined){if(h.hresume[0].summary!=""){ident.profiles[c].note[0]=h.hresume[0].summary}}}ident.createCombinedhCard();ident.profileAddedEvent()}if(e==false&&h.hresume[0].contact){hcard=h.hresume[0].contact;hcard.sourceUrl=b;hcard.domain=f;hcard.name=a;if(h.hresume[0].summary!=undefined){if(h.hresume[0].summary!=""){hcard.note[0]=h.hresume[0].summary}}if(hcard.fn!=""){ident.profiles[ident.profiles.length]=hcard}ident.createCombinedhCard();ident.profileAddedEvent()}if(h.hresume.length>0){for(var c=0;c<h.hresume.length;c++){h.hresume[c].sourceUrl=b;h.hresume[c].domain=f;h.hresume[c].name=a;ident.resumes[ident.resumes.length]=h.hresume[c]}}}}},_UfXtractAPICall:function(a,b){jQuery.getJSON(apiurl+"&callback=?",function(c){ident.ufxtract._parseUfData(c,a,b)})}};ident.registerParser(ident.ufxtract);
View
1  js/ident/ident-yql-parser-0.1.min.js
@@ -0,0 +1 @@
+ident.yql={parserName:"yql",parseUf:5,parseRss:10,parseAtom:10,findProfiles:function(){ident.yql.findContent("twitter.com","Profile","hCard",true);for(var a=0;a<ident.domains.length;a++){if(ident.domains[a].accounts!=null){ident.yql.findContent(ident.domains[a].domain,"Profile","hCard",true);ident.yql.findContent(ident.domains[a].domain,"Resume","hResume",true);ident.yql.findContent(ident.domains[a].domain,"Services","XFN",true)}}},findContent:function(d,h,c){var a="";var b="";for(var f=0;f<ident.domains.length;f++){if(ident.domains[f].domain==d){if(ident.domains[f].accounts!=null){var e=ident.domains[f];for(var j=0;j<e.accounts.length;j++){var g=e.accounts[j];var a=ident.getAPIEndPoint(h,c,e.urlmappings,g,1);if(a!=""){b=e.name;break}}}}}if(b!=""&&a!=""){ident.yql.loadContent(a,d,b,h,c)}},loadContent:function(b,e,a,c,d){if(ident.hasAPIBeenCalled(b,d,"")==false){ident.yql.getJson(b,e,a,c,d)}},getJson:function(b,f,a,d,e){if(b.indexOf("#")>0){var g=b.split("#");b=g[0]}var h=new ident.historyItem(b,"");h.apiName="yql";h.name=a;h.domain=f;h.schema=e;h.contentType=d;var c="microformats";if(e=="Rss"){c="rss"}if(e=="Atom"){c="atom"}query="select * from "+c+" where url='"+b+"'";apiurl="http://query.yahooapis.com/v1/public/yql?q="+encodeURIComponent(query)+"&format=json";h.apiurl=apiurl;if(f=="twitter.com"&&ident.getEnchancedTwitterProfile&&e=="hCard"){ident.getEnchancedTwitterProfile(b)}else{ident.history[ident.history.length]=h;jQuery.getJSON(apiurl+"&callback=?",function(i){ident.yql.processJson(i,f,a,d,h,c)})}},processJson:function(json,domain,name,type,historyItem,mediatype){ident._apiReturnCount++;if(ident.isObject(json)){yql=json}else{yql=eval("("+json+")")}historyItem.rawJSON=yql;if(mediatype=="rss"||mediatype=="atom"){if(yql.query){if(yql.query.results){if(yql.query.results.entry){if(yql.query.results.entry.length==null){singleEntry=yql.query.results.entry;yql.query.results.entry=new Array();yql.query.results.entry[0]=singleEntry}if(yql.query.results.entry.length){for(var x=0;x<=yql.query.results.entry.length-1;x++){hentry=ident.yql.parseAtomItem(yql.query.results.entry[x]);hentry.domain=domain;hentry.name=name;hentry.type=type;hentry.sourceUrl=historyItem.url;ident.postProcesshEntry(hentry);ident.entries[ident.entries.length]=hentry}ident.contentAddedEvent()}}if(yql.query.results.item){if(yql.query.results.item.length==null){singleItem=yql.query.results.item;yql.query.results.item=new Array();yql.query.results.item[0]=singleItem}if(yql.query.results.item.length){for(var x=0;x<=yql.query.results.item.length-1;x++){hentry=ident.yql.parseRssItem(yql.query.results.item[x]);hentry.domain=domain;hentry.name=name;hentry.type=type;hentry.sourceUrl=historyItem.url;ident.postProcesshEntry(hentry);ident.entries[ident.entries.length]=hentry}ident.contentAddedEvent()}}}}}if(mediatype=="microformats"){var UnStructuredhCards=null;var UnStructuredhResumes=null;var UnStructuredhEntry=null;var UnStructuredXFN=null;var ufCollection=new Array();var sourceUrl="";if(yql!=null){if(yql.query!=null){if(yql.query.results!=null){if(yql.query.results.result!=null){if(yql.query.results.result.url!=null){sourceUrl=yql.query.results.result.url}if(yql.query.results.result.feed!=null){if(yql.query.results.result.feed.adjunct!=null){if(yql.query.results.result.feed.adjunct.length!=null){for(var x=0;x<=yql.query.results.result.feed.adjunct.length-1;x++){var adjunct=yql.query.results.result.feed.adjunct[x];if(adjunct.id=="com.yahoo.page.uf.hcard"){UnStructuredhCards=adjunct}if(adjunct.id=="com.yahoo.page.uf.hresume"){UnStructuredhResumes=adjunct}if(adjunct.id=="com.yahoo.page.uf.hentry"){UnStructuredhEntry=adjunct}if(adjunct.id=="com.yahoo.page.uf.xfn"){UnStructuredXFN=adjunct}}}else{var adjunct=yql.query.results.result.feed.adjunct;if(adjunct.id=="com.yahoo.page.uf.hcard"){UnStructuredhCards=adjunct}if(adjunct.id=="com.yahoo.page.uf.hresume"){UnStructuredhResumes=adjunct}if(adjunct.id=="com.yahoo.page.uf.hentry"){UnStructuredhEntry=adjunct}if(adjunct.id=="com.yahoo.page.uf.xfn"){UnStructuredXFN=adjunct}}}}else{historyItem.error=true;historyItem.errorMessage="Not Found"}}}}}if(UnStructuredhCards!=null){hCards=ident.yql.parsehCards(UnStructuredhCards,domain,name,sourceUrl);ufCollection[ufCollection.length]={vcard:hCards};var hCard=null;if(hCards.length==1){hCard=hCards[0]}if(hCards.length>1){hCard=ident.findRepresentativehCard(hCards,domain)}if(hCard!=null){if(hCard.url){for(var i=0;i<hCard.url.length;i++){ident.appendDeclaredProfileUrl(hCard.url[i])}}if(hCard.fn){ident.appendFormattedName(hCard.fn.replace(" "," "))}ident.profiles[ident.profiles.length++]=hCard;ident.createCombinedhCard();jQuery(document).trigger("identify:profileAdded");jQuery(document).trigger("identify:statusUpdate",["data-change"])}}if(UnStructuredXFN!=null){ident.yql.parseXFN(UnStructuredXFN,domain,name,sourceUrl)}if(UnStructuredhResumes!=null){var hResume=ident.yql.parsehResumes(UnStructuredhResumes,domain,name,sourceUrl);ufCollection[ufCollection.length]={hresume:hResume};if(hResume.summary!=""){for(var i=0;i<ident.profiles.length;i++){if(hResume.domain==ident.profiles[i].domain){var note=new ident.valueTypeProperty();note.domain=domain;note.sourceUrl=sourceUrl;note.value=hResume.summary;ident.profiles[i].note[0]=note}}}jQuery(document).trigger("identify:statusUpdate",["data-change"]);ident.resumes[ident.resumes.length++]=hResume}historyItem.uf=ufCollection}},parseAtomItem:function(b){hentry=new ident.hEntry();hentry.id=b.id;hentry.author.fn=b.author.name;hentry.author.url[0]=b.author.uri;hentry.published=b.published;hentry.updated=b.updated;hentry["entry-title"]=b.title;hentry["entry-content"][0]=b.content.content;if(b.link){if(b.link.length){for(var a=0;a<b.link.length;a++){enclosure=new ident.enclosure();enclosure.link=b.link[a].href;enclosure.type=b.link[a].type;enclosure.rel=b.link[a].rel;hentry.enclosure[hentry.enclosure.length]=enclosure}}}return hentry},parseRssItem:function(a){hentry=new ident.hEntry();if(a.id){hentry.id=a.id}if(a.author){if(a.author.fn){hentry.author.fn=a.author.name}if(a.author.url){hentry.author.url[0]=a.author.uri}}if(a.pubDate){hentry.published=a.pubDate}if(a.title){hentry["entry-title"]=a.title}if(a.description){hentry["entry-content"][0]=a.description}if(a.summary){hentry.summary=a.summary}if(a.dtstart){hentry.dtstart=a.dtstart}if(a.dtend){hentry.dtend=a.dtend}if(a.location){hentry.location=a.location}if(a["x-calconnect-venue"]){if(a["x-calconnect-venue"].adr){venueAdr=a["x-calconnect-venue"].adr;hentry.venue=new Object();if(venueAdr["x-calconnect-venue-name"]){hentry.location=venueAdr["x-calconnect-venue-name"]}if(venueAdr["x-calconnect-street"]){hentry.venue["street-address"]=new Array();hentry.venue["street-address"][0]=venueAdr["x-calconnect-street"]}if(venueAdr["x-calconnect-city"]){hentry.venue.locality=venueAdr["x-calconnect-city"]}if(venueAdr["x-calconnect-region"]){hentry.venue.region=venueAdr["x-calconnect-region"]}if(venueAdr["x-calconnect-postalcode"]){hentry.venue["post-office-box"]=venueAdr["x-calconnect-postalcode"]}if(venueAdr["x-calconnect-country"]){hentry.venue["country-name"]=venueAdr["x-calconnect-country"]}}}if(a.enclosure){enclosure=new ident.enclosure();enclosure.link=a.enclosure.url;enclosure.type=a.enclosure.type;enclosure.length=a.enclosure.length;hentry.enclosure[hentry.enclosure.length]=enclosure}if(a.group){if(a.group.content){enclosure=new ident.enclosure();if(a.group.content.url){enclosure.link=a.group.content.url}if(a.group.content.type){enclosure.type=a.group.content.type}hentry.enclosure[hentry.enclosure.length]=enclosure}}if(a.date){hentry.published=a.date}if(a.link){hentry.link=a.link}return hentry},parsehCards:function(f,d,a,g){var l=new Array();if(f!=null){if(f.item!=null){if(ident.isArray(f.item)==false){f.item=new Array(f.item)}for(var e=0;e<=f.item.length-1;e++){if(f.item[e].type!=null){var h=new ident.hCard();h.domain=d;h.name=a;h.sourceUrl=g;if(f.item[e].type.meta!=null){if(ident.isArray(f.item[e].type.meta)){for(var m=0;m<=f.item[e].type.meta.length-1;m++){if(f.item[e].type.meta[m].property=="vcard:fn"){h.fn=f.item[e].type.meta[m].content}if(f.item[e].type.meta[m].property=="vcard:tel"){var c=new ident.valueTypeProperty();c.domain=d;c.sourceUrl=g;if(f.item[e].type.meta[m].content.toLowerCase().indexOf("work")>-1){c.type="work"}if(f.item[e].type.meta[m].content.indexOf(" : ")>0){var b=f.item[e].type.meta[m].content.split(" : ");c.value=b[1]}else{c.value=f.item[e].type.meta[m].content}h.tel[h.tel.length]=c}if(f.item[e].type.meta[m].property=="vcard:email"){var i=new ident.valueTypeProperty();i.domain=d;i.sourceUrl=g;i.valueOf=f.item[e].type.meta[m].content;h.email[h.email.length]=i}if(f.item[e].type.meta[m].property=="vcard:title"){if(f.item[e].type.meta[m].content!=undefined){h.title[h.title.length]=f.item[e].type.meta[m].content}}if(f.item[e].type.meta[m].property=="vcard:role"){if(f.item[e].type.meta[m].content!=undefined){h.title[h.title.length]=f.item[e].type.meta[m].content}}}}else{if(f.item[e].type.meta.property=="vcard:fn"){h.fn=f.item[e].type.meta.content}}}if(f.item[e].type.item!=null){if(ident.isArray(f.item[e].type.item)){for(var m=0;m<=f.item[e].type.item.length-1;m++){if(f.item[e].type.item[m].rel=="vcard:photo"){h.photo[h.photo.length]=f.item[e].type.item[m].resource}if(f.item[e].type.item[m].rel=="vcard:url"){h.url[h.url.length]=f.item[e].type.item[m].resource}if(f.item[e].type.item[m].rel=="vcard:org"){if(f.item[e].type.item[m].type!=null){if(f.item[e].type.item[m].type.meta!=null){if(f.item[e].type.item[m].type.meta.property=="vcard:organization-name"){var o=new ident.org();o["organization-name"]=f.item[e].type.item[m].type.meta.content;o.domain=d;o.sourceUrl=g;h.org[h.org.length]=o}}}}if(f.item[e].type.item[m].rel=="vcard:adr"){if(f.item[e].type.item[m].type!=null){if(f.item[e].type.item[m].type.meta!=null){var n=null;if(ident.isArray(f.item[e].type.item[m].type.meta)){h.adr[0]=new ident.adr();h.adr[0].domain=d;h.adr[0].sourceUrl=g;for(var k=0;k<=f.item[e].type.item[m].type.meta.length-1;k++){var n=f.item[e].type.item[m].type.meta[k];if(n.property=="vcard:extended-address"){h.adr[0]["extended-address"][0]=n.content}if(n.property=="vcard:street-address"){h.adr[0]["street-address"][0]=n.content}if(n.property=="vcard:locality"){h.adr[0].locality=n.content}if(n.property=="vcard:region"){h.adr[0].region=n.content}if(n.property=="vcard:postal-code"){h.adr[0]["postal-code"]=n.content}if(n.property=="vcard:country-name"){h.adr[0]["country-name"]=n.content}}}else{var n=f.item[e].type.item[m].type.meta;h.adr[0]=new ident.adr();if(n.property=="vcard:extended-address"){h.adr[0]["extended-address"][0]=n.content}if(n.property=="vcard:street-address"){h.adr[0]["street-address"][0]=n.content}if(n.property=="vcard:locality"){h.adr[0].locality=n.content}if(n.property=="vcard:region"){h.adr[0].region=n.content}if(n.property=="vcard:postal-code"){h.adr[0]["postal-code"]=n.content}if(n.property=="vcard:country-name"){h.adr[0]["country-name"]=n.content}}}}}}}else{if(f.item[e].type.item.rel=="vcard:url"){h.url[h.url.length++]=f.item[e].type.item.resource}}}}if(h.fn!=""){l[l.length]=h}}}}return l},parsehResumes:function(e,d,b,c){var a=new ident.hResume();a.domain=d;a.sourceUrl=c;if(e!=null){if(e.item!=null){if(e.item.type!=null){if(e.item.type.meta!=null){if(e.item.type.meta.property=="resume:summary"){if(e.item.type.meta.content!=undefined){a.summary=e.item.type.meta.content}}}}}}return a},parseXFN:function(e,d,b,c){for(var a=0;a<=e.item.length-1;a++){var f=new Object();f.domain=d;f.sourceUrl=c;f.name=b;if(e.item[a].rel=="xfn:me"){f.link=e.item[a].item.resource;ident.mes[ident.mes.length]=f;ident.xfn[ident.xfn.length]=f;ident.appendDeclaredProfileUrl(f.link);ident.appendDomainNode("",f.link,false,"");ident.appendAllProfileUrls(f.link)}}ident.postProcessDomainNode()},parseObjectsToString:function(a,b){if(ident.isObject(a)){for(prop in a){if(typeof a[prop]=="string"){if(prop=="content"){b+=a[prop]}}if(ident.isObject(a[prop])){b=ident.yql.parseObjectsToString(a[prop],b)}}}return b}};ident.registerParser(ident.yql);
View
1  js/ident/web-address.min.js
@@ -0,0 +1 @@
+webAddress={timerId1:null,timerId2:null,animate:true,string1:"",string2:"",elt:null,prefix:"i.e.",personasUserNames:new Array(),accountMappings:new Array(),accountMapping:function(b,a){this.uritemplate=b;this.name=a},init:function(){this.personasUserNames[0]="johnsmith";this.personasUserNames[1]="janeblack";this.accountMappings[0]=new this.accountMapping("http://twitter.com/{username}","twitter");this.accountMappings[1]=new this.accountMapping("http://friendfeed.com/{username}","friendfeed");this.accountMappings[2]=new this.accountMapping("http://www.flickr.com/people/{username}/","flickr");this.accountMappings[3]=new this.accountMapping("http://huffduffer.com/{username}","huffduffer");this.accountMappings[4]=new this.accountMapping("http://digg.com/users/{username}","digg");this.accountMappings[5]=new this.accountMapping("http://www.linkedin.com/in/{username}","linkedin");this.accountMappings[6]=new this.accountMapping("{username}@gmail.com","gmail")},setWebAddress:function(){if(this.personasUserNames.length==0){this.init()}var a=Math.ceil(this.accountMappings.length*Math.random());var b=Math.ceil(this.personasUserNames.length*Math.random());var d=this.accountMappings[a-1];var c=this.personasUserNames[b-1];if(d.uritemplate.indexOf("@")>-1){this.string1=d.uritemplate.replace("{username}",c);this.string2=d.uritemplate.replace("{username}",c)}else{this.string1=d.uritemplate.replace("{username}",c);this.string2=d.name+" "+c}$(this.elt).css({opacity:0});$(this.elt).html("<span>"+this.prefix+" "+this.string1+"</span>").animate({opacity:1},250).animate({opacity:1},3250).animate({opacity:0},250)},setString2:function(){$(this.elt).html("<span>"+this.prefix+" "+this.string2+"</span>").animate({opacity:1},250).animate({opacity:1},3250).animate({opacity:0},250)},stopAnimate:function(){this.clear();animate=false},startAnimate:function(){animate=true;this.update()},update:function(){if(animate){this.clear();this.setWebAddress();this.timerId1=setTimeout("webAddress.setString2()",4000);this.timerId2=setTimeout("webAddress.update()",8000)}},clear:function(){clearTimeout(this.timerId1);clearTimeout(this.timerId2)}};
View
0  js/jquery-1.7.1.min.js → js/libs/jquery-1.7.1.min.js
File renamed without changes
View
898 js/libs/twitter.text.js
@@ -0,0 +1,898 @@
+if (!window.twttr) {
+ window.twttr = {};
+}
+
+(function() {
+ twttr.txt = {};
+ twttr.txt.regexen = {};
+
+ var HTML_ENTITIES = {
+ '&': '&amp;',
+ '>': '&gt;',
+ '<': '&lt;',
+ '"': '&quot;',
+ "'": '&#39;'
+ };
+
+ // HTML escaping
+ twttr.txt.htmlEscape = function(text) {
+ return text && text.replace(/[&"'><]/g, function(character) {
+ return HTML_ENTITIES[character];
+ });
+ };
+
+ // Builds a RegExp
+ function regexSupplant(regex, flags) {
+ flags = flags || "";
+ if (typeof regex !== "string") {
+ if (regex.global && flags.indexOf("g") < 0) {
+ flags += "g";
+ }
+ if (regex.ignoreCase && flags.indexOf("i") < 0) {
+ flags += "i";
+ }
+ if (regex.multiline && flags.indexOf("m") < 0) {
+ flags += "m";
+ }
+
+ regex = regex.source;
+ }
+
+ return new RegExp(regex.replace(/#\{(\w+)\}/g, function(match, name) {
+ var newRegex = twttr.txt.regexen[name] || "";
+ if (typeof newRegex !== "string") {
+ newRegex = newRegex.source;
+ }
+ return newRegex;
+ }), flags);
+ }
+
+ // simple string interpolation
+ function stringSupplant(str, values) {
+ return str.replace(/#\{(\w+)\}/g, function(match, name) {
+ return values[name] || "";
+ });
+ }
+
+ function addCharsToCharClass(charClass, start, end) {
+ var s = String.fromCharCode(start);
+ if (end !== start) {
+ s += "-" + String.fromCharCode(end);
+ }
+ charClass.push(s);
+ return charClass;
+ }
+
+ // Space is more than %20, U+3000 for example is the full-width space used with Kanji. Provide a short-hand
+ // to access both the list of characters and a pattern suitible for use with String#split
+ // Taken from: ActiveSupport::Multibyte::Handlers::UTF8Handler::UNICODE_WHITESPACE
+ var fromCode = String.fromCharCode;
+ var UNICODE_SPACES = [
+ fromCode(0x0020), // White_Space # Zs SPACE
+ fromCode(0x0085), // White_Space # Cc <control-0085>
+ fromCode(0x00A0), // White_Space # Zs NO-BREAK SPACE
+ fromCode(0x1680), // White_Space # Zs OGHAM SPACE MARK
+ fromCode(0x180E), // White_Space # Zs MONGOLIAN VOWEL SEPARATOR
+ fromCode(0x2028), // White_Space # Zl LINE SEPARATOR
+ fromCode(0x2029), // White_Space # Zp PARAGRAPH SEPARATOR
+ fromCode(0x202F), // White_Space # Zs NARROW NO-BREAK SPACE
+ fromCode(0x205F), // White_Space # Zs MEDIUM MATHEMATICAL SPACE
+ fromCode(0x3000) // White_Space # Zs IDEOGRAPHIC SPACE
+ ];
+ addCharsToCharClass(UNICODE_SPACES, 0x009, 0x00D); // White_Space # Cc [5] <control-0009>..<control-000D>
+ addCharsToCharClass(UNICODE_SPACES, 0x2000, 0x200A); // White_Space # Zs [11] EN QUAD..HAIR SPACE
+
+ var INVALID_CHARS = [
+ fromCode(0xFFFE),
+ fromCode(0xFEFF), // BOM
+ fromCode(0xFFFF) // Special
+ ];
+ addCharsToCharClass(INVALID_CHARS, 0x202A, 0x202E); // Directional change
+
+ twttr.txt.regexen.spaces_group = regexSupplant(UNICODE_SPACES.join(""));
+ twttr.txt.regexen.spaces = regexSupplant("[" + UNICODE_SPACES.join("") + "]");
+ twttr.txt.regexen.invalid_chars_group = regexSupplant(INVALID_CHARS.join(""));
+ twttr.txt.regexen.punct = /\!'#%&'\(\)*\+,\\\-\.\/:;<=>\?@\[\]\^_{|}~/;
+ twttr.txt.regexen.atSigns = /[@@]/;
+ twttr.txt.regexen.extractMentions = regexSupplant(/(^|[^a-zA-Z0-9_])(#{atSigns})([a-zA-Z0-9_]{1,20})/g);
+ twttr.txt.regexen.extractReply = regexSupplant(/^(?:#{spaces})*#{atSigns}([a-zA-Z0-9_]{1,20})/);
+ twttr.txt.regexen.listName = /[a-zA-Z][a-zA-Z0-9_\-\u0080-\u00ff]{0,24}/;
+ twttr.txt.regexen.extractMentionsOrLists = regexSupplant(/(^|[^a-zA-Z0-9_])(#{atSigns})([a-zA-Z0-9_]{1,20})(\/[a-zA-Z][a-zA-Z0-9_\-]{0,24})?/g);
+
+ var nonLatinHashtagChars = [];
+ // Cyrillic
+ addCharsToCharClass(nonLatinHashtagChars, 0x0400, 0x04ff); // Cyrillic
+ addCharsToCharClass(nonLatinHashtagChars, 0x0500, 0x0527); // Cyrillic Supplement
+ addCharsToCharClass(nonLatinHashtagChars, 0x2de0, 0x2dff); // Cyrillic Extended A
+ addCharsToCharClass(nonLatinHashtagChars, 0xa640, 0xa69f); // Cyrillic Extended B
+ // Hangul (Korean)
+ addCharsToCharClass(nonLatinHashtagChars, 0x1100, 0x11ff); // Hangul Jamo
+ addCharsToCharClass(nonLatinHashtagChars, 0x3130, 0x3185); // Hangul Compatibility Jamo
+ addCharsToCharClass(nonLatinHashtagChars, 0xA960, 0xA97F); // Hangul Jamo Extended-A
+ addCharsToCharClass(nonLatinHashtagChars, 0xAC00, 0xD7AF); // Hangul Syllables
+ addCharsToCharClass(nonLatinHashtagChars, 0xD7B0, 0xD7FF); // Hangul Jamo Extended-B
+ addCharsToCharClass(nonLatinHashtagChars, 0xFFA1, 0xFFDC); // half-width Hangul
+ // Japanese and Chinese
+ addCharsToCharClass(nonLatinHashtagChars, 0x30A1, 0x30FA); // Katakana (full-width)
+ addCharsToCharClass(nonLatinHashtagChars, 0x30FC, 0x30FE); // Katakana Chouon and iteration marks (full-width)
+ addCharsToCharClass(nonLatinHashtagChars, 0xFF66, 0xFF9F); // Katakana (half-width)
+ addCharsToCharClass(nonLatinHashtagChars, 0xFF70, 0xFF70); // Katakana Chouon (half-width)
+ addCharsToCharClass(nonLatinHashtagChars, 0xFF10, 0xFF19); // \
+ addCharsToCharClass(nonLatinHashtagChars, 0xFF21, 0xFF3A); // - Latin (full-width)
+ addCharsToCharClass(nonLatinHashtagChars, 0xFF41, 0xFF5A); // /
+ addCharsToCharClass(nonLatinHashtagChars, 0x3041, 0x3096); // Hiragana
+ addCharsToCharClass(nonLatinHashtagChars, 0x3099, 0x309E); // Hiragana voicing and iteration mark
+ addCharsToCharClass(nonLatinHashtagChars, 0x3400, 0x4DBF); // Kanji (CJK Extension A)
+ addCharsToCharClass(nonLatinHashtagChars, 0x4E00, 0x9FFF); // Kanji (Unified)
+ // -- Disabled as it breaks the Regex.
+ //addCharsToCharClass(nonLatinHashtagChars, 0x20000, 0x2A6DF); // Kanji (CJK Extension B)
+ addCharsToCharClass(nonLatinHashtagChars, 0x2A700, 0x2B73F); // Kanji (CJK Extension C)
+ addCharsToCharClass(nonLatinHashtagChars, 0x2B740, 0x2B81F); // Kanji (CJK Extension D)
+ addCharsToCharClass(nonLatinHashtagChars, 0x2F800, 0x2FA1F); // Kanji (CJK supplement)
+ addCharsToCharClass(nonLatinHashtagChars, 0x3005, 0x3005); // Kanji iteration mark
+ addCharsToCharClass(nonLatinHashtagChars, 0x303B, 0x303B); // Han iteration mark
+
+ twttr.txt.regexen.nonLatinHashtagChars = regexSupplant(nonLatinHashtagChars.join(""));
+ // Latin accented characters (subtracted 0xD7 from the range, it's a confusable multiplication sign. Looks like "x")
+ twttr.txt.regexen.latinAccentChars = regexSupplant("ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþş\\303\\277");
+
+ twttr.txt.regexen.endScreenNameMatch = regexSupplant(/^(?:#{atSigns}|[#{latinAccentChars}]|:\/\/)/);
+
+ // A hashtag must contain characters, numbers and underscores, but not all numbers.
+ twttr.txt.regexen.hashtagAlpha = regexSupplant(/[a-z_#{latinAccentChars}#{nonLatinHashtagChars}]/i);
+ twttr.txt.regexen.hashtagAlphaNumeric = regexSupplant(/[a-z0-9_#{latinAccentChars}#{nonLatinHashtagChars}]/i);
+ twttr.txt.regexen.endHashtagMatch = /^(?:[##]|:\/\/)/;
+ twttr.txt.regexen.hashtagBoundary = regexSupplant(/(?:^|$|[^&\/a-z0-9_#{latinAccentChars}#{nonLatinHashtagChars}])/);
+ twttr.txt.regexen.autoLinkHashtags = regexSupplant(/(#{hashtagBoundary})(#|#)(#{hashtagAlphaNumeric}*#{hashtagAlpha}#{hashtagAlphaNumeric}*)/gi);
+ twttr.txt.regexen.autoLinkUsernamesOrLists = /(^|[^a-zA-Z0-9_]|RT:?)([@@]+)([a-zA-Z0-9_]{1,20})(\/[a-zA-Z][a-zA-Z0-9_\-]{0,24})?/g;
+ twttr.txt.regexen.autoLinkEmoticon = /(8\-\#|8\-E|\+\-\(|\`\@|\`O|\&lt;\|:~\(|\}:o\{|:\-\[|\&gt;o\&lt;|X\-\/|\[:-\]\-I\-|\/\/\/\/Ö\\\\\\\\|\(\|:\|\/\)|∑:\*\)|\( \| \))/g;
+
+ // URL related hash regex collection
+ twttr.txt.regexen.validPrecedingChars = regexSupplant(/(?:[^-\/"'!=A-Za-z0-9_@@##\.#{invalid_chars_group}]|^)/);
+
+ twttr.txt.regexen.invalidDomainChars = stringSupplant("#{punct}#{spaces_group}#{invalid_chars_group}", twttr.txt.regexen);
+ twttr.txt.regexen.validDomainChars = regexSupplant(/[^#{invalidDomainChars}]/);
+ twttr.txt.regexen.validSubdomain = regexSupplant(/(?:(?:#{validDomainChars}(?:[_-]|#{validDomainChars})*)?#{validDomainChars}\.)/);
+ twttr.txt.regexen.validDomainName = regexSupplant(/(?:(?:#{validDomainChars}(?:-|#{validDomainChars})*)?#{validDomainChars}\.)/);
+ twttr.txt.regexen.validGTLD = regexSupplant(/(?:(?:aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel)(?=[^a-zA-Z]|$))/);
+ twttr.txt.regexen.validCCTLD = regexSupplant(/(?:(?:ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)(?=[^a-zA-Z]|$))/);
+ twttr.txt.regexen.validPunycode = regexSupplant(/(?:xn--[0-9a-z]+)/);
+ twttr.txt.regexen.validDomain = regexSupplant(/(?:#{validSubdomain}*#{validDomainName}(?:#{validGTLD}|#{validCCTLD}|#{validPunycode}))/);
+ twttr.txt.regexen.validAsciiDomain = regexSupplant(/(?:(?:[a-z0-9#{latinAccentChars}]+)\.)+(?:#{validGTLD}|#{validCCTLD}|#{validPunycode})/gi);
+ twttr.txt.regexen.invalidShortDomain = regexSupplant(/^#{validDomainName}#{validCCTLD}$/);
+
+ twttr.txt.regexen.validPortNumber = regexSupplant(/[0-9]+/);
+
+ twttr.txt.regexen.validGeneralUrlPathChars = regexSupplant(/[a-z0-9!\*';:=\+,\.\$\/%#\[\]\-_~|&#{latinAccentChars}]/i);
+ // Allow URL paths to contain balanced parens
+ // 1. Used in Wikipedia URLs like /Primer_(film)
+ // 2. Used in IIS sessions like /S(dfd346)/
+ twttr.txt.regexen.validUrlBalancedParens = regexSupplant(/\(#{validGeneralUrlPathChars}+\)/i);
+ // Valid end-of-path chracters (so /foo. does not gobble the period).
+ // 1. Allow =&# for empty URL parameters and other URL-join artifacts
+ twttr.txt.regexen.validUrlPathEndingChars = regexSupplant(/[\+\-a-z0-9=_#\/#{latinAccentChars}]|(?:#{validUrlBalancedParens})/i);
+ // Allow @ in a url, but only in the middle. Catch things like http://example.com/@user/
+ twttr.txt.regexen.validUrlPath = regexSupplant('(?:' +
+ '(?:' +
+ '#{validGeneralUrlPathChars}*' +
+ '(?:#{validUrlBalancedParens}#{validGeneralUrlPathChars}*)*' +
+ '#{validUrlPathEndingChars}'+
+ ')|(?:@#{validGeneralUrlPathChars}+\/)'+
+ ')', 'i');
+
+ twttr.txt.regexen.validUrlQueryChars = /[a-z0-9!?\*'\(\);:&=\+\$\/%#\[\]\-_\.,~|]/i;
+ twttr.txt.regexen.validUrlQueryEndingChars = /[a-z0-9_&=#\/]/i;
+ twttr.txt.regexen.extractUrl = regexSupplant(
+ '(' + // $1 total match
+ '(#{validPrecedingChars})' + // $2 Preceeding chracter
+ '(' + // $3 URL
+ '(https?:\\/\\/)?' + // $4 Protocol (optional)
+ '(#{validDomain})' + // $5 Domain(s)
+ '(?::(#{validPortNumber}))?' + // $6 Port number (optional)
+ '(\\/#{validUrlPath}*)?' + // $7 URL Path
+ '(\\?#{validUrlQueryChars}*#{validUrlQueryEndingChars})?' + // $8 Query String
+ ')' +
+ ')'
+ , 'gi');
+
+ // These URL validation pattern strings are based on the ABNF from RFC 3986
+ twttr.txt.regexen.validateUrlUnreserved = /[a-z0-9\-._~]/i;
+ twttr.txt.regexen.validateUrlPctEncoded = /(?:%[0-9a-f]{2})/i;
+ twttr.txt.regexen.validateUrlSubDelims = /[!$&'()*+,;=]/i;
+ twttr.txt.regexen.validateUrlPchar = regexSupplant('(?:' +
+ '#{validateUrlUnreserved}|' +
+ '#{validateUrlPctEncoded}|' +
+ '#{validateUrlSubDelims}|' +
+ '[:|@]' +
+ ')', 'i');
+
+ twttr.txt.regexen.validateUrlScheme = /(?:[a-z][a-z0-9+\-.]*)/i;
+ twttr.txt.regexen.validateUrlUserinfo = regexSupplant('(?:' +
+ '#{validateUrlUnreserved}|' +
+ '#{validateUrlPctEncoded}|' +
+ '#{validateUrlSubDelims}|' +
+ ':' +
+ ')*', 'i');
+
+ twttr.txt.regexen.validateUrlDecOctet = /(?:[0-9]|(?:[1-9][0-9])|(?:1[0-9]{2})|(?:2[0-4][0-9])|(?:25[0-5]))/i;
+ twttr.txt.regexen.validateUrlIpv4 = regexSupplant(/(?:#{validateUrlDecOctet}(?:\.#{validateUrlDecOctet}){3})/i);
+
+ // Punting on real IPv6 validation for now
+ twttr.txt.regexen.validateUrlIpv6 = /(?:\[[a-f0-9:\.]+\])/i;
+
+ // Also punting on IPvFuture for now
+ twttr.txt.regexen.validateUrlIp = regexSupplant('(?:' +
+ '#{validateUrlIpv4}|' +
+ '#{validateUrlIpv6}' +
+ ')', 'i');
+
+ // This is more strict than the rfc specifies
+ twttr.txt.regexen.validateUrlSubDomainSegment = /(?:[a-z0-9](?:[a-z0-9_\-]*[a-z0-9])?)/i;
+ twttr.txt.regexen.validateUrlDomainSegment = /(?:[a-z0-9](?:[a-z0-9\-]*[a-z0-9])?)/i;
+ twttr.txt.regexen.validateUrlDomainTld = /(?:[a-z](?:[a-z0-9\-]*[a-z0-9])?)/i;
+ twttr.txt.regexen.validateUrlDomain = regexSupplant(/(?:(?:#{validateUrlSubDomainSegment]}\.)*(?:#{validateUrlDomainSegment]}\.)#{validateUrlDomainTld})/i);
+
+ twttr.txt.regexen.validateUrlHost = regexSupplant('(?:' +
+ '#{validateUrlIp}|' +
+ '#{validateUrlDomain}' +
+ ')', 'i');
+
+ // Unencoded internationalized domains - this doesn't check for invalid UTF-8 sequences
+ twttr.txt.regexen.validateUrlUnicodeSubDomainSegment = /(?:(?:[a-z0-9]|[^\u0000-\u007f])(?:(?:[a-z0-9_\-]|[^\u0000-\u007f])*(?:[a-z0-9]|[^\u0000-\u007f]))?)/i;
+ twttr.txt.regexen.validateUrlUnicodeDomainSegment = /(?:(?:[a-z0-9]|[^\u0000-\u007f])(?:(?:[a-z0-9\-]|[^\u0000-\u007f])*(?:[a-z0-9]|[^\u0000-\u007f]))?)/i;
+ twttr.txt.regexen.validateUrlUnicodeDomainTld = /(?:(?:[a-z]|[^\u0000-\u007f])(?:(?:[a-z0-9\-]|[^\u0000-\u007f])*(?:[a-z0-9]|[^\u0000-\u007f]))?)/i;
+ twttr.txt.regexen.validateUrlUnicodeDomain = regexSupplant(/(?:(?:#{validateUrlUnicodeSubDomainSegment}\.)*(?:#{validateUrlUnicodeDomainSegment}\.)#{validateUrlUnicodeDomainTld})/i);
+
+ twttr.txt.regexen.validateUrlUnicodeHost = regexSupplant('(?:' +
+ '#{validateUrlIp}|' +
+ '#{validateUrlUnicodeDomain}' +
+ ')', 'i');
+
+ twttr.txt.regexen.validateUrlPort = /[0-9]{1,5}/;
+
+ twttr.txt.regexen.validateUrlUnicodeAuthority = regexSupplant(
+ '(?:(#{validateUrlUserinfo})@)?' + // $1 userinfo
+ '(#{validateUrlUnicodeHost})' + // $2 host
+ '(?::(#{validateUrlPort}))?' //$3 port
+ , "i");
+
+ twttr.txt.regexen.validateUrlAuthority = regexSupplant(
+ '(?:(#{validateUrlUserinfo})@)?' + // $1 userinfo
+ '(#{validateUrlHost})' + // $2 host
+ '(?::(#{validateUrlPort}))?' // $3 port
+ , "i");
+
+ twttr.txt.regexen.validateUrlPath = regexSupplant(/(\/#{validateUrlPchar}*)*/i);
+ twttr.txt.regexen.validateUrlQuery = regexSupplant(/(#{validateUrlPchar}|\/|\?)*/i);
+ twttr.txt.regexen.validateUrlFragment = regexSupplant(/(#{validateUrlPchar}|\/|\?)*/i);
+
+ // Modified version of RFC 3986 Appendix B
+ twttr.txt.regexen.validateUrlUnencoded = regexSupplant(
+ '^' + // Full URL
+ '(?:' +
+ '([^:/?#]+):\\/\\/' + // $1 Scheme
+ ')?' +
+ '([^/?#]*)' + // $2 Authority
+ '([^?#]*)' + // $3 Path
+ '(?:' +
+ '\\?([^#]*)' + // $4 Query
+ ')?' +
+ '(?:' +
+ '#(.*)' + // $5 Fragment
+ ')?$'
+ , "i");
+
+
+ // Default CSS class for auto-linked URLs
+ var DEFAULT_URL_CLASS = "tweet-url";
+ // Default CSS class for auto-linked lists (along with the url class)
+ var DEFAULT_LIST_CLASS = "list-slug";
+ // Default CSS class for auto-linked usernames (along with the url class)
+ var DEFAULT_USERNAME_CLASS = "username";
+ // Default CSS class for auto-linked hashtags (along with the url class)
+ var DEFAULT_HASHTAG_CLASS = "hashtag";
+ // HTML attribute for robot nofollow behavior (default)
+ var HTML_ATTR_NO_FOLLOW = " rel=\"nofollow\"";
+
+ // Simple object cloning function for simple objects
+ function clone(o) {
+ var r = {};
+ for (var k in o) {
+ if (o.hasOwnProperty(k)) {
+ r[k] = o[k];
+ }
+ }
+
+ return r;
+ }
+
+ twttr.txt.autoLink = function(text, options) {
+ options = clone(options || {});
+ return twttr.txt.autoLinkUsernamesOrLists(
+ twttr.txt.autoLinkUrlsCustom(
+ twttr.txt.autoLinkHashtags(text, options),
+ options),
+ options);
+ };
+
+
+ twttr.txt.autoLinkUsernamesOrLists = function(text, options) {
+ options = clone(options || {});
+
+ options.urlClass = options.urlClass || DEFAULT_URL_CLASS;
+ options.listClass = options.listClass || DEFAULT_LIST_CLASS;
+ options.usernameClass = options.usernameClass || DEFAULT_USERNAME_CLASS;
+ options.usernameUrlBase = options.usernameUrlBase || "http://twitter.com/";
+ options.listUrlBase = options.listUrlBase || "http://twitter.com/";
+ if (!options.suppressNoFollow) {
+ var extraHtml = HTML_ATTR_NO_FOLLOW;
+ }
+
+ var newText = "",
+ splitText = twttr.txt.splitTags(text);
+
+ for (var index = 0; index < splitText.length; index++) {
+ var chunk = splitText[index];
+
+ if (index !== 0) {
+ newText += ((index % 2 === 0) ? ">" : "<");
+ }
+
+ if (index % 4 !== 0) {
+ newText += chunk;
+ } else {
+ newText += chunk.replace(twttr.txt.regexen.autoLinkUsernamesOrLists, function(match, before, at, user, slashListname, offset, chunk) {
+ var after = chunk.slice(offset + match.length);
+
+ var d = {
+ before: before,
+ at: at,
+ user: twttr.txt.htmlEscape(user),
+ slashListname: twttr.txt.htmlEscape(slashListname),
+ extraHtml: extraHtml,
+ preChunk: "",
+ chunk: twttr.txt.htmlEscape(chunk),
+ postChunk: ""
+ };
+ for (var k in options) {
+ if (options.hasOwnProperty(k)) {
+ d[k] = options[k];
+ }
+ }
+
+ if (slashListname && !options.suppressLists) {
+ // the link is a list
+ var list = d.chunk = stringSupplant("#{user}#{slashListname}", d);
+ d.list = twttr.txt.htmlEscape(list.toLowerCase());
+ return stringSupplant("#{before}#{at}<a class=\"#{urlClass} #{listClass}\" href=\"#{listUrlBase}#{list}\"#{extraHtml}>#{preChunk}#{chunk}#{postChunk}</a>", d);
+ } else {
+ if (after && after.match(twttr.txt.regexen.endScreenNameMatch)) {
+ // Followed by something that means we don't autolink
+ return match;
+ } else {
+ // this is a screen name
+ d.chunk = twttr.txt.htmlEscape(user);
+ d.dataScreenName = !options.suppressDataScreenName ? stringSupplant("data-screen-name=\"#{chunk}\" ", d) : "";
+ return stringSupplant("#{before}#{at}<a class=\"#{urlClass} #{usernameClass}\" #{dataScreenName}href=\"#{usernameUrlBase}#{chunk}\"#{extraHtml}>#{preChunk}#{chunk}#{postChunk}</a>", d);
+ }
+ }
+ });
+ }
+ }
+
+ return newText;
+ };
+
+ twttr.txt.autoLinkHashtags = function(text, options) {
+ options = clone(options || {});
+ options.urlClass = options.urlClass || DEFAULT_URL_CLASS;
+ options.hashtagClass = options.hashtagClass || DEFAULT_HASHTAG_CLASS;
+ options.hashtagUrlBase = options.hashtagUrlBase || "http://twitter.com/search?q=%23";
+ if (!options.suppressNoFollow) {
+ var extraHtml = HTML_ATTR_NO_FOLLOW;
+ }
+
+ return text.replace(twttr.txt.regexen.autoLinkHashtags, function(match, before, hash, text, offset, chunk) {
+ var after = chunk.slice(offset + match.length);
+ if (after.match(twttr.txt.regexen.endHashtagMatch))
+ return match;
+
+ var d = {
+ before: before,
+ hash: twttr.txt.htmlEscape(hash),
+ preText: "",
+ text: twttr.txt.htmlEscape(text),
+ postText: "",
+ extraHtml: extraHtml
+ };
+
+ for (var k in options) {
+ if (options.hasOwnProperty(k)) {
+ d[k] = options[k];
+ }
+ }
+
+ return stringSupplant("#{before}<a href=\"#{hashtagUrlBase}#{text}\" title=\"##{text}\" class=\"#{urlClass} #{hashtagClass}\"#{extraHtml}>#{hash}#{preText}#{text}#{postText}</a>", d);
+ });
+ };
+
+
+ twttr.txt.autoLinkUrlsCustom = function(text, options) {
+ options = clone(options || {});
+ if (!options.suppressNoFollow) {
+ options.rel = "nofollow";
+ }
+ if (options.urlClass) {
+ options["class"] = options.urlClass;
+ delete options.urlClass;
+ }
+
+ // remap url entities to hash
+ var urlEntities, i, len;
+ if(options.urlEntities) {
+ urlEntities = {};
+ for(i = 0, len = options.urlEntities.length; i < len; i++) {
+ urlEntities[options.urlEntities[i].url] = options.urlEntities[i];
+ }
+ }
+
+ delete options.suppressNoFollow;
+ delete options.suppressDataScreenName;
+ delete options.listClass;
+ delete options.usernameClass;
+ delete options.usernameUrlBase;
+ delete options.listUrlBase;
+
+ return text.replace(twttr.txt.regexen.extractUrl, function(match, all, before, url, protocol, port, domain, path, queryString) {
+ var tldComponents;
+
+ if (protocol) {
+ var htmlAttrs = "";
+ for (var k in options) {
+ htmlAttrs += stringSupplant(" #{k}=\"#{v}\" ", {k: k, v: options[k].toString().replace(/"/, "&quot;").replace(/</, "&lt;").replace(/>/, "&gt;")});
+ }
+
+ var d = {
+ before: before,
+ htmlAttrs: htmlAttrs,
+ url: twttr.txt.htmlEscape(url)
+ };
+ if (urlEntities && urlEntities[url] && urlEntities[url].display_url) {
+ d.displayUrl = twttr.txt.htmlEscape(urlEntities[url].display_url);
+ } else {
+ d.displayUrl = d.url;
+ }
+
+ return stringSupplant("#{before}<a href=\"#{url}\"#{htmlAttrs}>#{displayUrl}</a>", d);
+ } else {
+ return all;
+ }
+ });
+ };
+
+ twttr.txt.extractMentions = function(text) {
+ var screenNamesOnly = [],
+ screenNamesWithIndices = twttr.txt.extractMentionsWithIndices(text);
+
+ for (var i = 0; i < screenNamesWithIndices.length; i++) {
+ var screenName = screenNamesWithIndices[i].screenName;
+ screenNamesOnly.push(screenName);
+ }
+
+ return screenNamesOnly;
+ };
+
+ twttr.txt.extractMentionsWithIndices = function(text) {
+ if (!text) {
+ return [];
+ }
+
+ var possibleScreenNames = [],
+ position = 0;
+
+ text.replace(twttr.txt.regexen.extractMentions, function(match, before, atSign, screenName, offset, chunk) {
+ var after = chunk.slice(offset + match.length);
+ if (!after.match(twttr.txt.regexen.endScreenNameMatch)) {
+ var startPosition = text.indexOf(atSign + screenName, position);
+ position = startPosition + screenName.length + 1;
+ possibleScreenNames.push({
+ screenName: screenName,
+ indices: [startPosition, position]
+ });
+ }
+ });
+
+ return possibleScreenNames;
+ };
+
+ /**
+ * Extract list or user mentions.
+ * (Presence of listSlug indicates a list)
+ */
+ twttr.txt.extractMentionsOrListsWithIndices = function(text) {
+ if (!text) {
+ return [];
+ }
+
+ var possibleNames = [],
+ position = 0;
+
+ text.replace(twttr.txt.regexen.extractMentionsOrLists, function(match, before, atSign, screenName, slashListname, offset, chunk) {
+ var after = chunk.slice(offset + match.length);
+ if (!after.match(twttr.txt.regexen.endScreenNameMatch)) {
+ slashListname = slashListname || '';
+ var startPosition = text.indexOf(atSign + screenName + slashListname, position);
+ position = startPosition + screenName.length + slashListname.length + 1;
+ possibleNames.push({
+ screenName: screenName,
+ listSlug: slashListname,
+ indices: [startPosition, position]
+ });
+ }
+ });
+
+ return possibleNames;
+ };
+
+
+ twttr.txt.extractReplies = function(text) {
+ if (!text) {
+ return null;
+ }
+
+ var possibleScreenName = text.match(twttr.txt.regexen.extractReply);
+ if (!possibleScreenName ||
+ RegExp.rightContext.match(twttr.txt.regexen.endScreenNameMatch)) {
+ return null;
+ }
+
+ return possibleScreenName[1];
+ };
+
+ twttr.txt.extractUrls = function(text) {
+ var urlsOnly = [],
+ urlsWithIndices = twttr.txt.extractUrlsWithIndices(text);
+
+ for (var i = 0; i < urlsWithIndices.length; i++) {
+ urlsOnly.push(urlsWithIndices[i].url);
+ }
+
+ return urlsOnly;
+ };
+
+ twttr.txt.extractUrlsWithIndices = function(text) {
+ if (!text) {
+ return [];
+ }
+
+ var urls = [],
+ position = 0;
+
+ text.replace(twttr.txt.regexen.extractUrl, function(match, all, before, url, protocol, domain, port, path, query) {
+ var startPosition = text.indexOf(url, position),
+ endPosition = startPosition + url.length;
+
+ // if protocol is missing and domain contains non-ASCII characters,
+ // extract ASCII-only domains.
+ if (!protocol) {
+ var lastUrl = null,
+ lastUrlInvalidMatch = false,
+ asciiEndPosition = 0;
+ domain.replace(twttr.txt.regexen.validAsciiDomain, function(asciiDomain) {
+ var asciiStartPosition = domain.indexOf(asciiDomain, asciiEndPosition);
+ asciiEndPosition = asciiStartPosition + asciiDomain.length
+ lastUrl = {
+ url: asciiDomain,
+ indices: [startPosition + asciiStartPosition, startPosition + asciiEndPosition]
+ }
+ lastUrlInvalidMatch = asciiDomain.match(twttr.txt.regexen.invalidShortDomain);
+ if (!lastUrlInvalidMatch) {
+ urls.push(lastUrl);
+ }
+ });
+
+ // no ASCII-only domain found. Skip the entire URL.
+ if (lastUrl == null) {
+ return;
+ }
+
+ // lastUrl only contains domain. Need to add path and query if they exist.
+ if (path) {
+ if (lastUrlInvalidMatch) {
+ urls.push(lastUrl);
+ }
+ lastUrl.url = url.replace(domain, lastUrl.url);
+ lastUrl.indices[1] = endPosition;
+ }
+ } else {
+ urls.push({
+ url: url,
+ indices: [startPosition, endPosition]
+ });
+ }
+ });
+
+ return urls;
+ };
+
+ twttr.txt.extractHashtags = function(text) {
+ var hashtagsOnly = [],
+ hashtagsWithIndices = twttr.txt.extractHashtagsWithIndices(text);
+
+ for (var i = 0; i < hashtagsWithIndices.length; i++) {
+ hashtagsOnly.push(hashtagsWithIndices[i].hashtag);
+ }
+
+ return hashtagsOnly;
+ };
+
+ twttr.txt.extractHashtagsWithIndices = function(text) {
+ if (!text) {
+ return [];
+ }
+
+ var tags = [],
+ position = 0;
+
+ text.replace(twttr.txt.regexen.autoLinkHashtags, function(match, before, hash, hashText, offset, chunk) {
+ var after = chunk.slice(offset + match.length);
+ if (after.match(twttr.txt.regexen.endHashtagMatch))
+ return;
+ var startPosition = text.indexOf(hash + hashText, position);
+ position = startPosition + hashText.length + 1;
+ tags.push({
+ hashtag: hashText,
+ indices: [startPosition, position]
+ });
+ });
+
+ return tags;
+ };
+
+ // this essentially does text.split(/<|>/)
+ // except that won't work in IE, where empty strings are ommitted
+ // so "<>".split(/<|>/) => [] in IE, but is ["", "", ""] in all others
+ // but "<<".split("<") => ["", "", ""]
+ twttr.txt.splitTags = function(text) {
+ var firstSplits = text.split("<"),
+ secondSplits,
+ allSplits = [],
+ split;
+
+ for (var i = 0; i < firstSplits.length; i += 1) {
+ split = firstSplits[i];
+ if (!split) {
+ allSplits.push("");
+ } else {
+ secondSplits = split.split(">");
+ for (var j = 0; j < secondSplits.length; j += 1) {
+ allSplits.push(secondSplits[j]);
+ }
+ }
+ }
+
+ return allSplits;
+ };
+
+ twttr.txt.hitHighlight = function(text, hits, options) {
+ var defaultHighlightTag = "em";
+
+ hits = hits || [];
+ options = options || {};
+
+ if (hits.length === 0) {
+ return text;
+ }
+
+ var tagName = options.tag || defaultHighlightTag,
+ tags = ["<" + tagName + ">", "</" + tagName + ">"],
+ chunks = twttr.txt.splitTags(text),
+ split,
+ i,
+ j,
+ result = "",
+ chunkIndex = 0,
+ chunk = chunks[0],
+ prevChunksLen = 0,
+ chunkCursor = 0,
+ startInChunk = false,
+ chunkChars = chunk,
+ flatHits = [],
+ index,
+ hit,
+ tag,
+ placed,
+ hitSpot;
+
+ for (i = 0; i < hits.length; i += 1) {
+ for (j = 0; j < hits[i].length; j += 1) {
+ flatHits.push(hits[i][j]);
+ }
+ }
+
+ for (index = 0; index < flatHits.length; index += 1) {
+ hit = flatHits[index];
+ tag = tags[index % 2];
+ placed = false;
+
+ while (chunk != null && hit >= prevChunksLen + chunk.length) {
+ result += chunkChars.slice(chunkCursor);
+ if (startInChunk && hit === prevChunksLen + chunkChars.length) {
+ result += tag;
+ placed = true;
+ }
+
+ if (chunks[chunkIndex + 1]) {
+ result += "<" + chunks[chunkIndex + 1] + ">";
+ }
+
+ prevChunksLen += chunkChars.length;
+ chunkCursor = 0;
+ chunkIndex += 2;
+ chunk = chunks[chunkIndex];
+ chunkChars = chunk;
+ startInChunk = false;
+ }
+
+ if (!placed && chunk != null) {
+ hitSpot = hit - prevChunksLen;
+ result += chunkChars.slice(chunkCursor, hitSpot) + tag;
+ chunkCursor = hitSpot;
+ if (index % 2 === 0) {
+ startInChunk = true;
+ } else {
+ startInChunk = false;
+ }
+ } else if(!placed) {
+ placed = true;
+ result += tag;
+ }
+ }
+
+ if (chunk != null) {
+ if (chunkCursor < chunkChars.length) {
+ result += chunkChars.slice(chunkCursor);
+ }
+ for (index = chunkIndex + 1; index < chunks.length; index += 1) {
+ result += (index % 2 === 0 ? chunks[index] : "<" + chunks[index] + ">");
+ }
+ }
+
+ return result;
+ };
+
+ var MAX_LENGTH = 140;
+
+ // Characters not allowed in Tweets
+ var INVALID_CHARACTERS = [
+ // BOM
+ fromCode(0xFFFE),
+ fromCode(0xFEFF),
+
+ // Special
+ fromCode(0xFFFF),
+
+ // Directional Change
+ fromCode(0x202A),
+ fromCode(0x202B),
+ fromCode(0x202C),
+ fromCode(0x202D),
+ fromCode(0x202E)
+ ];
+
+ // Check the text for any reason that it may not be valid as a Tweet. This is meant as a pre-validation
+ // before posting to api.twitter.com. There are several server-side reasons for Tweets to fail but this pre-validation
+ // will allow quicker feedback.
+ //
+ // Returns false if this text is valid. Otherwise one of the following strings will be returned:
+ //
+ // "too_long": if the text is too long
+ // "empty": if the text is nil or empty
+ // "invalid_characters": if the text contains non-Unicode or any of the disallowed Unicode characters
+ twttr.txt.isInvalidTweet = function(text) {
+ if (!text) {
+ return "empty";
+ }
+
+ if (text.length > MAX_LENGTH) {
+ return "too_long";
+ }
+
+ for (var i = 0; i < INVALID_CHARACTERS.length; i++) {
+ if (text.indexOf(INVALID_CHARACTERS[i]) >= 0) {
+ return "invalid_characters";
+ }
+ }
+
+ return false;
+ };
+
+ twttr.txt.isValidTweetText = function(text) {
+ return !twttr.txt.isInvalidTweet(text);
+ };
+
+ twttr.txt.isValidUsername = function(username) {
+ if (!username) {
+ return false;
+ }
+
+ var extracted = twttr.txt.extractMentions(username);
+
+ // Should extract the username minus the @ sign, hence the .slice(1)
+ return extracted.length === 1 && extracted[0] === username.slice(1);
+ };
+
+ var VALID_LIST_RE = regexSupplant(/^#{autoLinkUsernamesOrLists}$/);
+
+ twttr.txt.isValidList = function(usernameList) {
+ var match = usernameList.match(VALID_LIST_RE);
+
+ // Must have matched and had nothing before or after
+ return !!(match && match[1] == "" && match[4]);
+ };
+
+ twttr.txt.isValidHashtag = function(hashtag) {
+ if (!hashtag) {
+ return false;
+ }
+
+ var extracted = twttr.txt.extractHashtags(hashtag);
+
+ // Should extract the hashtag minus the # sign, hence the .slice(1)
+ return extracted.length === 1 && extracted[0] === hashtag.slice(1);
+ };
+
+ twttr.txt.isValidUrl = function(url, unicodeDomains, requireProtocol) {
+ if (unicodeDomains == null) {
+ unicodeDomains = true;
+ }
+
+ if (requireProtocol == null) {
+ requireProtocol = true;
+ }
+
+ if (!url) {
+ return false;
+ }
+
+ var urlParts = url.match(twttr.txt.regexen.validateUrlUnencoded);
+
+ if (!urlParts || urlParts[0] !== url) {
+ return false;
+ }
+
+ var scheme = urlParts[1],
+ authority = urlParts[2],
+ path = urlParts[3],
+ query = urlParts[4],
+ fragment = urlParts[5];
+
+ if (!(
+ (!requireProtocol || (isValidMatch(scheme, twttr.txt.regexen.validateUrlScheme) && scheme.match(/^https?$/i))) &&
+ isValidMatch(path, twttr.txt.regexen.validateUrlPath) &&
+ isValidMatch(query, twttr.txt.regexen.validateUrlQuery, true) &&
+ isValidMatch(fragment, twttr.txt.regexen.validateUrlFragment, true)
+ )) {
+ return false;
+ }
+
+ return (unicodeDomains && isValidMatch(authority, twttr.txt.regexen.validateUrlUnicodeAuthority)) ||
+ (!unicodeDomains && isValidMatch(authority, twttr.txt.regexen.validateUrlAuthority));
+ };
+
+ function isValidMatch(string, regex, optional) {
+ if (!optional) {
+ // RegExp["$&"] is the text of the last match
+ // blank strings are ok, but are falsy, so we check stringiness instead of truthiness
+ return ((typeof string === "string") && string.match(regex) && RegExp["$&"] === string);
+ }
+
+ // RegExp["$&"] is the text of the last match
+ return (!string || (string.match(regex) && RegExp["$&"] === string));
+ }
+
+ if (typeof module != 'undefined' && module.exports) {
+ module.exports = twttr.txt;
+ }
+
+}());
View
7 manifest.json
@@ -2,11 +2,16 @@
"name": "HackerNew",
"version": "0.1",
"description": "Making hacker news more useful.",
+ "background_page": "background.html",
"content_scripts": [
{
"matches": ["http://news.ycombinator.com/*"],
"css": ["hn.css"],
- "js": ["js/jquery-1.7.1.min.js", "js/hn.js"]
+ "js": [
+ "js/libs/jquery-1.7.1.min.js",
+ "js/libs/twitter.text.js",
+ "js/hn.js"
+ ]
}
]
}
Please sign in to comment.
Something went wrong with that request. Please try again.