Sample 2 - User Input Try it!
The following mashup presents the output of CPB in News Reader style. It takes the OpenCalais API key from user input, thus allowing you to share the mashup without making your own OpenCalais API key public.
Note that the Calais Popfly Block takes input from two sources - the Twitter block and a User Input block. We use the User Input block to provide the OpenCalais API key.
The individual blocks in this mashup are configured as follows:
User Input
This block will request the user for the OpenCalais API key before running the mashup.
Once again we set a high number of posts, assuming that many are filtered out as they contain non-English characters.
Calais Popfly Block
In this mashup we set enrichText to false. This means that the text field in the output will be the same as in the input of the block. Note the setting of licenseID to the value taken from the User Input block. There is no OpenCalais API key in any of the blocks of this mashup, so we can share it safely.
News Reader
Finally we set the headline argument to the text field of CPB. Recall that enrichText is false, so this is the text member of the Twitter block unchanged. We set content to be the calaisText field of CPB. Here we show the entities found by OpenCalais.
Result
When we run the mashup we get the following result:
Once we enter a valid OpenCalais API key and click Go we get:
