This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | |
url = 'http://www.hemnet.se/resultat'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Simple type checking | |
*/ | |
(function(name, definition) { | |
if (typeof define == 'function' && define.amd) { | |
define(name, definition); | |
} else if (typeof module != 'undefined') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(name, definition) { | |
if (typeof define == 'function' && define.amd) { | |
define(name, definition); | |
} else if (typeof module != 'undefined') { | |
module.exports = definition(); | |
} else { | |
this[name] = definition(); | |
} | |
}('thing', function() { | |
var thing = function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Person = function(name) { | |
this.name = name; | |
} | |
Person.prototype = (function() { | |
var aPrivateMethod = function() {}; | |
return { | |
constructor: Person, |
NewerOlder