UNPKG

elsewhere

Version:

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

49 lines (40 loc) 1.78 kB
<p>Elsewhere requires <a href='http://nodejs.org'>Node.js</a> to be installed first.</p> <p>Clone the repo and start the server by running these commands in the terminal:</p> <pre><code>git clone git@github.com:dharmafly/elsewhere.git cd elsewhere npm install bin/elsewhere</code></pre> <p>Now head to <a href='http://localhost:8888'><code>localhost:8888</code></a>. You can test the API on this page by entering a URL into the &#8216;url&#8217; box and clicking &#8216;Parse&#8217;. This will render the graph as a list on the page, complete with the names of each page of the graph and their respective favicons.</p> <p>You can also test the API by simply appending the target URL to your address bar like so:</p> <pre><code>http://localhost:8888/?url=chrisnewtn.com</code></pre> <p>This will return a JSON version of the graph e.g.</p> <pre><code>{ results: [ { url: &quot;http://chrisnewtn.com&quot;, title: &quot;Chris Newton&quot;, favicon: &quot;http://chrisnewtn.com/favicon.ico&quot;, outboundLinks: { verified: [ ... ], unverified: [ ] }, inboundCount: { verified: 4, unverified: 0 }, verified: true, urlAliases: [ &quot;http://t.co/vV5BWNxil2&quot; ] } ], warnings: [ &quot;http error: 404 (Not Found) - http://twitter.com/statuses/user_timeline/chrisnewtn.rss&quot; ], query: &quot;http://chrisnewtn.com&quot;, created: &quot;2012-10-12T16:30:57.270Z&quot;, crawled: 9, verified: 9 }</code></pre> <p>The initial crawl will take a while, as each page needs to be visited, checked and cached. Once cached though, it should be pretty snappy.</p> <p><strong><a href='reference/'>See the API Reference</a></strong> for more details.</p>