Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first

  • Loading branch information...
commit 8701c352a24c25549a8e3d6633519814a299e068 0 parents
@rgarcia authored
4 .gitignore
@@ -0,0 +1,4 @@
+node_modules
+*~
+.DS_Store
+\#*\#
1  Procfile
@@ -0,0 +1 @@
+web: node web.js
7 package.json
@@ -0,0 +1,7 @@
+{
+ "name": "node-example",
+ "version": "0.0.1",
+ "dependencies": {
+ "express": "2.2.0"
+ }
+}
10 scraper/package.json
@@ -0,0 +1,10 @@
+{
+ "name": "instacss-scraper",
+ "version": "0.0.1",
+ "dependencies": {
+ "requirejs": ">=1.0.0",
+ "mongoose": ">=2.3.9",
+ "underscore": ">=1.2.1",
+ "scraper": ">=0.0.9"
+ }
+}
30 scraper/web.js
@@ -0,0 +1,30 @@
+var scraper = require('scraper');
+var mongoose = require('mongoose');
+
+var Schema = mongoose.Schema;
+var ObjectId = Schema.ObjectId;
+
+var CSSProperty = new Schema({
+ id : ObjectId,
+ name : { type: String, required: true },
+ description : { type: String, required: true },
+ possibleValues : [String],
+ relatedProperties : [String]
+});
+
+var CSSProperty = mongoose.model('CSSProperty',CSSProperty);
+
+
+
+var urlroot = 'http://www.htmldog.com/reference/cssproperties/';
+
+scraper('http://www.htmldog.com/reference/cssproperties/', function(err, jQuery) {
+ if (err) {throw err}
+
+ jQuery('#sec a').each(function() {
+ var str = jQuery(this).attr('href').trim();
+ str = str.slice(0,str.length-1);
+ console.log(urlroot + str);
+ });
+
+});
12 web.js
@@ -0,0 +1,12 @@
+var express = require('express');
+
+var app = express.createServer(express.logger());
+
+app.get('/', function(request, response) {
+ response.send('Hello World!');
+});
+
+var port = process.env.PORT || 3000;
+app.listen(port, function() {
+ console.log("Listening on " + port);
+});
Please sign in to comment.
Something went wrong with that request. Please try again.