Skip to content

gurdotan/domo.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Domo.js

Utility functions for domain strings.

Usage

Download domo.js and include it in your HTML file by sticking the following line in the <head> section:

<script src="<PATH>/<TO>/<JAVASCRIPTS>/domo.js" type="text/javascript"></script>

Now you can use Domo's functions on domain strings. Try it in code or in a javascript console:

> Domo.canonicalize("www.ebay.com")
=> "ebay.com"

> Domo.canonicalize("boats.ebay.co.uk")
=> "ebay.co.uk"

> Domo.canonicalize("edition.cnn.com")
=> "cnn.com"

> Domo.stripUrl("http://www.cnn.com/news/last-week/main.html")
=> "www.cnn.com"

Testing Notes

The unit tests are written in Pavlov, a QUnit backed framework for BDD. To run the tests, just fire up a browser and open spec/domo.specs.html.

Copyright (c) 2011 Gur Dotan, released under the MIT license.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published