Git Product home page Git Product logo

stylify-me's Introduction

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. Download PhantomJS and copy it to REPOFOLDER/vendor/phantomjs/bin/phantomjs or update the path in app.js
var config = {
	binPath : "vendor/phantomjs/bin/phantomjs"
	....
};
  1. 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;
		.....
	}
  1. Start the nodeJs app with node app.js
  2. Query http://localhost:5000/query?url=http%3A%2F%2Fgoogle.com (assuming you run your app on port 5000) and you should be able to see a JSON response

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.");
});

stylify-me's People

Contributors

anilkk avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.