ColdFusion Code Sample
This is some commented code in ColdFusion to help you get started using the OpenAmplify API. This code sample comes from one of our esteemed community members: (read the original post here)
"Yesterday I discovered a service called OpenAmplify. OpenAmplify is a free API that provides deep, and I mean really deep, textual analysis. Currently they only support English, and I've no idea how long the service will remain free, but the level of detail their analysis provides is pretty darn stunning. As an example of the level of detail it provides, when I used their API to scan this blog, it was able to tell me:
- I'm a male adult (which, ok, to be fair, is pretty easy to guess ;)
- My writing has a high level of decisiveness and is somewhat flamboyant (cool)
- It says I offer guidance "a lot" which is very accurate
- My content is more positive than negative
- My topics include computers, computer programming, html, ajax, etc
- And waaay more info than I can describe here
Along with parsing a URL, you can also check individual strings. So for example, I wrote up a CFC wrapper that allows you to just do this:"
1 <cfset oa = new openamplify("my key")>
2 <cfset res = oa.parse(text="This is a test of the openamplify system. It is slick!")>
I then dumped out the polarity:
1 <cfdump var="#res.styles.polarity#">
*as with any other code, please use at your discretion.
