Skip to content
Website style analyzer for designers. This is the service part that does the analyzation etc.
JavaScript HTML
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.fonts
lib issue #9 fixed and jquery updated Nov 7, 2014
public staging init Apr 20, 2013
views fixes Apr 20, 2013
.buildpacks buildpack update Oct 4, 2014
.gitignore no idea why the node_modules folder was ever added to the project Oct 3, 2014
LICENSE
Procfile
README.md update to latest express and phantom via npn-package Apr 14, 2018
app.js
package-lock.json
package.json
phantom-rasterize.js don't exit on page errors Apr 14, 2018
stylify-crawler.js change user-agent to safari 9 Apr 14, 2018

README.md

Stylify Me

A Style Guide Generator - using NodeJS and PhantomJS, a command line webkit browser. See it live at http://stylifyme.com

This repo only contains the web service. We host our app on Heroku using the multi buildpack.

Running the service locally

  1. Make sure you have NodeJS installed and running

  2. Install dependencies with npm npm install

  3. Update the referer url check in "app.js" with the url of your frontend (local and production):

    isRefererValid : function(referer){
    		var validRefs = ["http://stylifyme.com", "http://www.stylifyme.com", "http://stylify.herokuapp.com", "http://localhost:9185", "http://localhost:" + app.get('port')]
    			,isvalid = false;
    		.....
    	}
  4. Start the nodeJs app with node app.js

  5. Query http://localhost:5000/query?url=https%3A%2F%2Fgoogle.com (assuming you run your app on port 5000) and you should be able to see a JSON response I recomend using Postman for debugging your api

Frontend

This repo only contains the web service, you can query it from the front end like this:

var urlToQuery = encodeURIComponent("http://google.com");

$.ajax({
	dataType: "jsonp",
	url: "http://youreServiceUrl.com/query?url="+ urlToQuery,
	success: function(data){
		if(data["error"]){
			alert("Error: " + data["error"]);
			return;
		}
		//PROCESS the result
	},
	timeout : 10000
}).fail(function(){
	alert("Could not query site, the service might be down, please try again later.");
});
You can’t perform that action at this time.