Use Quotes on Your Own Site!
Posted Aug. 28, 2008 at 10:53 a.m. by wheaties
Earlier today I finally got around to adding a feature that a few people have requested: the ability to quickly and easily include quotes from QuoteBoards.org on other Web sites. The process is quite simple.
You have two options:
A JavaScript Include
This is probably the preferred way to include quotes on your own site, as it gives you more freedom to style them however you'd like so they can match your existing design and layout. To use this method, simply include something like this in your Web page code wherever you want the quotes to show up:
<script src="http://www.quoteboards.org/feeds/gadget.js?url=members/wheaties.rss" type="text/javascript"></script>
Nice, short, and sweet, right? Later on I will show you how you can customize what you get.
An IFrame
If you don't really care about your quotes fitting into your existing layout and design, the iframe might be for you--it will look pretty similar to QuoteBoards itself. To use this method, do something like this:
<iframe src="http://www.quoteboards.org/feeds/gadget/?url=members/wheaties.rss" style="height: 500px; width: 500px; border: none"></iframe>
Customizing Your Quotes
Obviously, you probably don't want to have my quotes showing up on your site, right? You have many ways of customizing what quotes you get using the url parameter. There are also several other parameters that you can use. All parameters need to be separated by an ampersand (&).
- url: This is how you can determine which quotes you'll see. It's the only required parameter. Here are some options for the url parameter.
- quotes.rss: This will pull in quotes from any and all member QuoteBoards
- tags/[tag].rss: This will limit the quotes to any quotes that have been tagged with [tag] (replace [tag] with an actual tag; example: tags/love.rss)
- members/[member name].rss: This will limit the quotes to any quotes that were added by [member name] (replace [member name] with an actual member's name; example: members/wheaties.rss)
- speaker/[speaker name].rss: This will limit the quotes to any quotes by [speaker name] (replace [speaker name] with an actual name; example: speaker/C.S. Lewis.rss)
- notitle: Set this to true if you don't want a title included with your quotes. Example: notitle=true.
- nodesc: Set this to true if you don't want a description to be included with your quotes. Example: nodesc=true.
- random: Set this to true if you want the quotes to be random. Example: random=true.
- count: The number of quotes you want to show. Example: count=1.
IFrame Specific Parameters
When you're using the IFrame method, you might want to customize things a little bit, and there are some options for that:
- bgcolor: a hexademical color code for the page background, without the pound (#) symbol in front
- fgcolor: a hexademical color code for the text color, without the pound (#) symbol in front
- linkcolor: a hexademical color code for the color of links, without the pound (#) symbol in front
- bg1: a hexadecimal color code for the "odd" quotes' background, without the pound (#) symbol in front
- bg2: a hexadecimal color code for the "even" quotes' background, without the pound (#) symbol in front
- fontsize: a valid CSS(Cascading Style Sheet) font size
More Examples
To wrap this all up, I will share a few more examples:
JavaScript: 1 Random Quote From My Quotes, No Title/Description
<script src="http://www.quoteboards.org/feeds/gadget.js?url=members/wheaties.rss&random=true&count=1¬itle=true&nodesc=true" type="text/javascript"></script>
IFrame: 1 Random Quote From My Quotes, No Title/Description
<iframe src="http://www.quoteboards.org/feeds/gadget/?url=members/wheaties.rss&random=true&count=1¬itle=true&nodesc=true" style="height: 500px; width: 500px; border: none"></iframe>
JavaScript: 2 Random Quotes From C.S. Lewis
<script src="http://www.quoteboards.org/feeds/gadget.js?url=speaker/C.S. Lewis.rss&random=true&count=2" type="text/javascript"></script>
IFrame: 2 Random Quotes From C.S. Lewis
<iframe src="http://www.quoteboards.org/feeds/gadget/?url=speaker/C.S. Lewis.rss&random=true&count=2" style="height: 500px; width: 500px; border: none"></iframe>
JavaScript: 5 Quotes Most Recently Added And Tagged 'education'
<script src="http://www.quoteboards.org/feeds/gadget.js?url=tags/education.rss&count=5" type="text/javascript"></script>
IFrame: 5 Quotes Most Recently Added And Tagged 'education'
<iframe src="http://www.quoteboards.org/feeds/gadget/?url=tags/education.rss&count=5" style="height: 500px; width: 500px; border: none"></iframe>
Please comment if you have any questions or problems!!
Comments
chansen |
Thanks. This is great and works great.
Posted on
28 Aug. 2008 at 1:06 p.m.
|