BigSEO
BigSEO is a ExpresJS module built for apps who need a SEO Engine exclusively for web crawlers such as Google, Bing, Facebook, etc.
BigSEO is a simple middleware for expressjs to handle crawler requests.
npm install bigseo --save
Things you can make crawlers see if you use BigSEO:
- AngularJS rendered pages
- Disqus comments
- Facebook comments
- Javascript dom modifications
- etc
Things you can do if you use BigSEO:
- Add crawlers meta tags via javascript
- Load your content through AJAX
- Write AngularJS applications with no worries about SEO
- etc
###TODO:
- List robots user agents
- Implement Express 3.x compatibility
- Work without jquery
- Other language compatibility
ExpressJS 4.x
It is very simple to use BigSEO. Under your server application, insert this code snippet right before your route definitions. From now on, we will route every crawler request directly to an existing cache. If there is no cache, we will proceed with the request to the default response.
var bigSeo = require('bigseo')();
app.use(bigSeo.run());
BigSEO have a few optional configurations that you can put in the constructor.
opts = {
log: true,
cache_url: '/save/cache',
cache_path: 'caches'
};
Ex: var bigSeo = require('bigseo')({log: false});
At the moment you start your express application, BigSEO will create by default a caches/
where it will save the cached content.
The cache name is a base64.html generated from the saved url.
Saving your cache
Now, in order to build your cache, just put this tag on the html page you want to be ativated.
<script src='/bigseo/bigseo.js'></script>
And run the save method when you think the DOM is ready to be saved.
var bigSeo = new BigSEO();
bigSeo.save();
The save method accepts 2 parameters, the success and the error callback in that specific order.
The BigSEO client construct also accepts a opts
parameter with the following default value:
opts = {
url: '/save/cache'
};
Ex: var bigSeo = new BigSEO({url: '/cache'});
Warning: If you change the save path on your express application, your also have to change in the client settings
user-agents reference
The user agents reference can be found here.
You can find the list of implemented user agents here.
Please contribute by adding more relevant items to the list!
LICENSE
The MIT License (MIT)
Copyright (c) [2014] [Rafael Grillo Abreu]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.