Interfacing to the DataNibble Services

To display our data nibbles on your pages you need to carry out some simple modifications to your site.

  1. To use our services you must be able to use PHP cgi scripts and Service Side Includes (SSI) on your hosting server. Please check that these are available before signing up for a service.
  2. All user authentication and access control is done using the 3Scale API's. So first you will need to register with 3scale and create your access keys.
  3. Then download one of two files. Change the file extension from '._php' to '.php' and save the file in the cgi-bin directory on your web server. (On some browsers you may need to use 'Right-click'/Save As)
  4. Edit the file and insert your 3Scale access keys in the correct places.
  5. Inserting the nibble on your page requires a Server Side Include, so each page on which the nibble will appear you need to rename the file from .html to .shtml. Most hosting services support SSI automatically, but some services may require you to enable it manually. If your nibble does not appear check with your service for the exact details of how to enable SSI.
  6. Finally, at the point on the page where you want to display the nibble place the following code

Daily Quote


		 <!--#include virtual="/cgi-bin/qotd.php" --> 

			

Random Quotes


		 <!--#include virtual="/cgi-bin/random_quote.php" --> 

			

And that's it. Reload the page and your page will now be 'nibbled'.

If you need further support please email tech@datanibble.com

Formatting Quotes.

When Quote data is send from our server it is contained in an html div containing two further divs. You can add lines to your CSS file to change the formatting and appearance of the contents of the data.

The data returned from the server looks like this.


<div class="dn_qotd">
        <div class="dn_quote">There are four kinds of Homicide: felonious, 
                                             excusable, justifiable, and praiseworthy.</div>
        <div class="dn_author">Ambrose Bierce</div>
</div>
                        

In your CSS file you can add the following lines to set the colors, font, spacing etc.

				
				.dn_qotd {
					background:gray;
					font-size: 1em;
					padding-bottom:0.5em;
					width:250px;
				}
				.dn_quote {
					background:inherit;
					font-style: italic;
					color: black;
				}
				.dn_author {
					background:inherit;
					color: blue;
				}
			

So as an example the displayed version would look like this, but you can use the CSS to set any font, format or colour that you like.

There are four kinds of Homicide: felonious, excusable, justifiable, and praiseworthy.
Ambrose Bierce