UNPKG

elsewhere

Version:

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

27 lines (14 loc) 2.57 kB
<p>Instead of using a local options object each time you call the <code>graph()</code> method, you can also set global options by setting properties in the <code>elsewhere.options</code> object.</p> <p>Global options act as default values, which can then be overriden by options passed when calling the <code>graph()</code> method.</p> <p><strong>strict</strong> (boolean) Whether the crawler allows only reciprocal <code>rel=&quot;me&quot;</code> links or not. A reciprocal link is where the page at a URL links to another page in the graph, and a page in the graph links back to the original URL. When <code>true</code>, there will be no false positives, but fewer results. Default: <code>false</code></p> <p><strong>logLevel</strong> (integer) There are 4 levels of logging in Elsewhere: 4 - log, 3 - info, 2 - warn and 1 - error. The 4 setting gives the most granular logs, which are useful in a debugging scenario. Default: <code>3</code></p> <p><strong>crawlLimit</strong> (integer) The number of links that Elsewhere will follow without a successful verification before it abandons the chain. Default: <code>3</code></p> <p><strong>domainLimit</strong> (integer) The number of links crawled within a particular domain before the crawling of subsequent links in the domain is abandoned. Default: <code>3</code></p> <p><strong>stripDeeperLinks</strong> (boolean) If set to <code>true</code> then Elsewhere will remove links from the graph if they are at a deeper path than other links in the same domain. For example, <code>plus.google.com/{id}</code> is retained, but <code>plus.google.com/{id}/posts</code> is discarded. This is useful, for example, to strip out paginated contacts pages on social networks. Default: <code>true</code></p> <p><strong>useCache</strong> Whether a request should use the cache during a request. Default: <code>true</code></p> <p><strong>cacheTimeLimit</strong> The amount of time, in milliseconds, that graphs and pages are kept in the cache before they are discarded. Default: <code>3600000</code></p> <p><strong>cacheItemLimit</strong> (integer) The maximum number of items that can be kept in the cache before the oldest items are discarded. Use to limit memory. Default: <code>1000</code></p> <p><strong>httpHeaders</strong> (object) An object the HTTP header properties use when requesting resources from the internet.</p> <p>For example:</p> <pre><code>elsewhere.options.strict = false;</code></pre> <p>If you are running Elsewhere as a server, then you may set the options directly in <code>lib/options.js</code>.</p>