Skip to content

ExpressJS middleware to intercept social service crawlers and handle them differently

Notifications You must be signed in to change notification settings

adityavm/socialbots-interceptor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

socialbots-interceptor

An ExpressJS middleware to intercept requests from social media service crawlers (like Twitter, Facebook) and allow defining a custom handler.

Usage

const Interceptor = require("socialbots-interceptor");
// ...
app.use(Interceptor(cfg, (req, res, next) => {
  // ...
  res.status(404).send("Not found");
}));

Options

  • shouldProceed (boolean, default false) makes the interceptor non-blocking
  • shouldWait (boolean, default false) waits on a promise from the given callback to proceed

Note Enabling either of them is not recommended. Your handler should completely handle and respond to the request, then quit.

Supports

Currently supports:

  • Twitter (Twitterbot)
  • Facebook (facebookexternalhit)

About

ExpressJS middleware to intercept social service crawlers and handle them differently

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published