A library to canonicalize JSON urls (to facilitate result caching by url)
C++ C
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Makefile.am
README
base64.cpp
base64.h
builder.h
config.h.in
configure.in
hex.h
inline_decls.h
jsonobj.cpp
jsonobj.h
main.cpp
pch.h
stringutils.h
urlcanon.cpp
urlcanon.h
urldecode.cpp
urldecode.h

README

To build this project, you will need to install and build the boost libraries from 
http://www.boost.org/users/news/version_1_44_0. 

Once you have downloaded boost, you will need to build it via, first, the 
bootstrap.sh script and then the bjam command.Once built, you will need to 
copy the boost headers directory, boost, to /usr/local/include and copy 
the STATIC versions of libboost_thread.a,libboost_filesystem.a,and libboost_system.a
to /usr/local/lib. OR you could change Makefile.am to suit your preferences :-)

Once this is done, you can run the normal autotools sequence, aclocal, automake --add-missing,
libtoolize, autoconf,automake, ./configure and make

canonicalize, the app, takes the url via stdin and spits out the canonical version via stdout.
input parameters are: --exclude=<param to exclude>, --json=<identify json param> and --verbose,
to produce verbose output. An example of an exclusion might be your desire to remove the jsonp 
parameter from the caonical url. you can chain any combination of exclude and json commands. 

An example invocation might be: 

echo "http://www.foo.bar.com/doSomething.cgi?json3={      'include_schema':true,'filters':[{'o':'is','fieldId':3265206,'v':'2010'}],'limit':20,'offset':80,'search':{'field_ids':[],'value':''},'sort':[{'asc':true,'fieldId':3265209}]}&two=2&json2={two:2,one:1}" | ./canonicalize --exclude=jsonp --json=json3 --json=json2 --verbose

which would produce the following output: 

canonicalizeURL took:209 microseconds
original url:http://www.foo.bar.com/doSomething.cgi?json3={      'include_schema':true,'filters':[{'o':'is','fieldId':3265206,'v':'2010'}],'limit':20,'offset':80,'search':{'field_ids':[],'value':''},'sort':[{'asc':true,'fieldId':3265209}]}&two=2&json2={two:2,one:1}
canonical url:http://www.foo.bar.com/doSomething.cgi?json2={'one':1,'two':2}&json3={'filters':[{'fieldId':3265206,'o':'is','v':'2010'}],'include_schema':1,'limit':20,'offset':80,'search':{'field_ids':[],'value':''},'sort':[{'asc':1,'fieldId':3265209}]}&two=2
original decoded:http://www.foo.bar.com/doSomething.cgi?json3={      'include_schema':true,'filters':[{'o':'is','fieldId':3265206,'v':'2010'}],'limit':20,'offset':80,'search':{'field_ids':[],'value':''},'sort':[{'asc':true,'fieldId':3265209}]}&two=2&json2={two:2,one:1}
canoncial decoded:http://www.foo.bar.com/doSomething.cgi?json2={'one':1,'two':2}&json3={'filters':[{'fieldId':3265206,'o':'is','v':'2010'}],'include_schema':1,'limit':20,'offset':80,'search':{'field_ids':[],'value':''},'sort':[{'asc':1,'fieldId':3265209}]}&two=2