Repository: scotch-io/node-web-scraper
Branch: master
Commit: 044071bccf27
Files: 4
Total size: 2.0 KB
Directory structure:
gitextract_g72w4jjs/
├── .gitignore
├── README.md
├── package.json
└── server.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
logs
results
npm-debug.log
node_modules
================================================
FILE: README.md
================================================
node-web-scraper
================
Simple web scraper to get a movie name, release year and community rating from IMDB.
To run this example use the following commands:
``` shell
$ npm install
$ node server.js
```
Then it will start up our node server, navigate to http://localhost:8081/scrape and see what happens.
================================================
FILE: package.json
================================================
{
"name" : "node-web-scrape",
"version" : "0.0.1",
"description" : "Scrape le web.",
"main" : "server.js",
"author" : "Scotch",
"repository" : {
"type" : "git",
"url" : "https://github.com/scotch-io/node-web-scraper"
},
"dependencies" : {
"express" : "latest",
"request" : "latest",
"cheerio" : "latest"
}
}
================================================
FILE: server.js
================================================
var express = require('express');
var fs = require('fs');
var request = require('request');
var cheerio = require('cheerio');
var app = express();
app.get('/scrape', function(req, res){
// Let's scrape Anchorman 2
url = 'http://www.imdb.com/title/tt1229340/';
request(url, function(error, response, html){
if(!error){
var $ = cheerio.load(html);
var title, release, rating;
var json = { title : "", release : "", rating : ""};
$('.title_wrapper').filter(function(){
var data = $(this);
title = data.children().first().text().trim();
release = data.children().last().children().last().text().trim();
json.title = title;
json.release = release;
})
$('.ratingValue').filter(function(){
var data = $(this);
rating = data.text().trim();
json.rating = rating;
})
}
fs.writeFile('output.json', JSON.stringify(json, null, 4), function(err){
console.log('File successfully written! - Check your project directory for the output.json file');
})
res.send('Check your console!')
})
})
app.listen('8081')
console.log('Magic happens on port 8081');
exports = module.exports = app;
gitextract_g72w4jjs/ ├── .gitignore ├── README.md ├── package.json └── server.js
Condensed preview — 4 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2K chars).
[
{
"path": ".gitignore",
"chars": 97,
"preview": "lib-cov\n*.seed\n*.log\n*.csv\n*.dat\n*.out\n*.pid\n*.gz\n\npids\nlogs\nresults\n\nnpm-debug.log\nnode_modules\n"
},
{
"path": "README.md",
"chars": 318,
"preview": "node-web-scraper\n================\n\nSimple web scraper to get a movie name, release year and community rating from IMDB.\n"
},
{
"path": "package.json",
"chars": 386,
"preview": "{\n \"name\" : \"node-web-scrape\",\n \"version\" : \"0.0.1\",\n \"description\" : \"Scrape le web.\",\n \"main\" "
},
{
"path": "server.js",
"chars": 1226,
"preview": "var express = require('express');\nvar fs = require('fs');\nvar request = require('request');\nvar cheerio = require('"
}
]
About this extraction
This page contains the full source code of the scotch-io/node-web-scraper GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 4 files (2.0 KB), approximately 645 tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.