Note:
This page is due for an update but until then you can add StackAd to your site by adding:
<script type='text/javascript' src='http://files.quickmediasolutions.com/stackad/stackad.min.js'> </script>to the
<head>
section of your page and sticking the following<div>
on the page where you want the ads to appear:<div class='stackad' data-site='stackoverflow.com'></div>...where
data-site
is the parent site of the Stack Exchange site whose ads you want to display.
Screenshot / Code Snippet
StackAd demo available here.
About
StackAd pulls the answers from this question that have 6 or more upvotes and displays a random ad in the box. The code is provided as a .js file you can embed in your pages. The instructions are here.
License
As is common with all of my open-source apps, I am going with the MIT license.
Download
http://stackoverflow.quickmediasolutions.com/stackad/stackad.js <- This file can be hotlinked and has been minified to save bandwidth
http://stackoverflow.quickmediasolutions.com/stackad/stackad-source.js <- This is the source
http://stackoverflow.quickmediasolutions.com/stackad/test.html <- to see a demo
http://stackoverflow.quickmediasolutions.com/stackad/fancy.html <- to see an even better demo
Platform
The code should work with any JavaScript enabled browser.
Contact
I can be reached at [email protected]
Code
The code is written in JavaScript and uses the Soapi.js wrapper for interfacing with the API.
stackad.js
, a few suggestions: 1) Check for JQuery and include it's not there (hotlink to the Google Hosted version), 2) Check for SOAPI.js and include it automatically if it's not there. 3) The ID of "banner" is incredibly common. Maybe call it "so-oss-banner" or something? This way it's an all-in-one solution and is really just a copy/paste solution. Also, 4) for your own bandwidths sake, you might want to run it through a minifier. That copyright notice will cost you a lot of money if you're not careful Other than that, looking good!Soapi.js
andSoapi.Generated.js
?