Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

API and Developer Hub Kits Notes

Gray Brooks edited this page Jun 10, 2014 · 4 revisions

A Recipe for Using Stack Exchange as a Feedback Engine

The Open Data Stack Exchange is growing and vibrant forum for developer engagement of all kinds. By leveraging this existing community instead of trying to build a new one from scratch, a program can both better serve customers as well as benefit from the wisdom of others more easily.

  • From the data or developer hub, link directly to the question prompt and configure the URL to include a common tag that you're asking questioners to use. This makes it faster and easier for your users to correctly tag their questions. For example, the 'Got Questions' link on Open.FDA.gov goes to: https://opendata.stackexchange.com/questions/ask?tags=openFDA.
  • Recent questions with your tag can also be embedded in a page on your site, by pulling in the Atom XML feed specific to the tag. For instance, on Data.gov/contact, the feed for the data.gov tag on the Open Data Stack Exchange is pulled in using a simple php snipppet:
            <?php
            $feed  = fetch_feed( 'http://opendata.stackexchange.com/feeds/tag/data.gov' ); // specify feed url
            $items = $feed->get_items( 0, 7 ); // specify first and last item

            if ( ! empty( $items ) ) :
                foreach ( $items as $item ) : ?>
                    <div class="foreign-post">
                        <h4 class="post-title">
                            <a href="<?php echo $item->get_link(); ?>"><?php echo $item->get_title(); ?></a>
                        </h4>

                        <div class="post-date">
                            <?php echo $item->get_date( 'F d, Y h:i A' ); ?>
                        </div>
                    </div>

                    <?php endforeach; ?>

                <?php endif; ?>