UNPKG

elsewhere

Version:

A node project that aims to replicate the functionality of the Google Social Graph API

38 lines (20 loc) 4.05 kB
<p>To use Elsewhere, simply provide it with a URL. Elsewhere will use this target as the entry point to the graph and will search it for links that contain the attribute <a href='http://microformats.org/wiki/rel-me'><code>rel=me</code></a>:</p> <pre><code>&lt;a href=&quot;http://dharmafly.com&quot; rel=&quot;me&quot;&gt;Dharmafly&lt;/a&gt;</code></pre> <p>The <code>rel=me</code> attribute is a microformat to assert that the link is to a website, page or resource that is owned by (or is about) the same person as the page the link is on.</p> <p>For example, if you&#8217;ve given Elsewhere a URL that&#8217;s a Twitter profile, they usually contain a link to that person or company&#8217;s webpage; this link has the <code>rel=me</code> microformat.</p> <p>When Elsewhere finds a <code>rel=me</code> link or links at a URL, it searches each of them for more, building a comprehensive graph along the way.</p> <p>For example, a person&#8217;s Twitter profile page may link to his or her home page, which in turn links to their Last.fm, Flickr, Facebook, GitHub, LinkedIn, Google+ profiles etc.</p> <p>Elsewhere can only search public profiles and webpages for links. If a page isn&#8217;t public, Elsewhere can&#8217;t search it for links. It&#8217;s also worth noting that profile owners deliberately place these links on their profiles to make them discoverable. If the profile owner has neglected to place a link there, Elsewhere won&#8217;t find one.</p> <p>Once Elsewhere has run out of new <code>rel=me</code> links to search, it returns a list of all the URLs it has found. This list is what is referred to as the &#8216;social graph&#8217;, the owner of which being the owner of the URL you initially gave Elsewhere.</p> <h2 id='strict_mode_and_verified_links'>Strict Mode and verified links</h2> <p>Elsewhere can make strict checks to verify that that each linked URL is indeed owned by the same person as the original site. After all, anyone could create a website, add a <code>rel=me</code> link to <a href='http://www.elvis.com'>Elvis Presley</a>&#8217;s website and claim to be him.</p> <p>Elsewhere checks if the linked page itself has a <code>rel=me</code> link back to the original URL. If there is such a reciprocal link, then the relationship is deemed to be &#8216;verified&#8217;.</p> <p>But Elsewhere is more sophisticated than that. The reciprocal link doesn&#8217;t have to be directly between the two sites. For example, if a Twitter account links to a GitHub account, which links to a home page, which links back to the Twitter account, then the relationship between the Twitter account and home page will be verified, even though the two don&#8217;t directly link to each other.</p> <p>Elsewhere operates in non-strict mode by default, in which it will return both verified and unverified URLs. This mode is useful because many profile pages and personal websites lack <code>rel=me</code> links, making it difficult to verify those links and leading to many legitimate links being missed.</p> <p>To be absolutely sure of the stated relationships, turn on strict mode (by setting the <code>strict</code> option to <code>true</code>) and only verified URLs will be returned.</p> <h2 id='url_shortners_and_redirects'>URL shortners and redirects</h2> <p>When elsewhere follows a link and that link resolves to a different URL, that new resolved URL takes precedence over the original. For instance:</p> <pre><code>http://github.com/chrisnewtn -&gt; https://github.com/chrisnewtn http://t.co/vV5BWNxil2 -&gt; http://chrisnewtn.com</code></pre> <p>The original links to a page are still shown in the graph in that page&#8217;s <code>urlAliases</code> collection, but as far as the rest of the graph is concerned, that link is now known by its resolved name.</p> <p>Were URL shorteners and redirects ignored, you&#8217;d end up with a situation where both <code>http://github.com/user</code> and <code>https://github.com/user</code> were in your graph as two seperate pages, which is clearly incorrect.</p>