mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Export Spiderable symbol, so people can override user agents. Also add twitterbot to agents. Fixes #1300.
This commit is contained in:
@@ -7,6 +7,8 @@ Package.on_use(function (api) {
|
||||
api.use(['templating'], 'client');
|
||||
api.use(['underscore'], ['client', 'server']);
|
||||
|
||||
api.export('Spiderable', 'server');
|
||||
|
||||
api.add_files('spiderable.html', 'client');
|
||||
api.add_files('spiderable.js', 'server');
|
||||
});
|
||||
|
||||
@@ -9,7 +9,13 @@ Spiderable = {};
|
||||
// not obey the _escaped_fragment_ protocol. The page is served
|
||||
// statically to any client whos user agent matches any of these
|
||||
// regexps. Users may modify this array.
|
||||
Spiderable.userAgentRegExps = [/^facebookexternalhit/i, /^linkedinbot/i];
|
||||
//
|
||||
// An original goal with the spiderable package was to avoid doing
|
||||
// user-agent based tests. But the reality is not enough bots support
|
||||
// the _escaped_fragment_ protocol, so we need to hardcode a list
|
||||
// here. I shed a silent tear.
|
||||
Spiderable.userAgentRegExps = [
|
||||
/^facebookexternalhit/i, /^linkedinbot/i, /^twitterbot/i];
|
||||
|
||||
// how long to let phantomjs run before we kill it
|
||||
var REQUEST_TIMEOUT = 15*1000;
|
||||
|
||||
Reference in New Issue
Block a user