API

Documentation

Huffduffer is filled with lists of huffduffed items.

  • http://huffduffer.com/new
  • http://huffduffer.com/username
  • http://huffduffer.com/tags/tag
  • http://huffduffer.com/username/tags/tag
  • http://huffduffer.com/username/collective
  • http://huffduffer.com/username/collective/tags/tag
  • http://huffduffer.com/search?q=query
  • http://huffduffer.com/popular?dtstart=YYYY-MM-DD&dtend=YYYY-MM-DD

These lists are available in a number of formats. Specify a file format by appending it to the end of a URL.

All responses are encoded in UTF-8.

Older lists can be requested by passing a page value in the query string e.g. ?page=2

You can also use YQL—the Yahoo Query Language—to retrieve the same data.

RSS

An RSS feed of 20 items.

Mime-type:
application/xml+rss
Structure:
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>string</title>
    <description>string</description>
    <language>en</language>
    <link>Huffduffer URL</link>
    <atom:link href="Huffduffer RSS URL" rel="self" type="application/rss+xml"/>
    <item>
      <title>string</title>
      <description>string</description>
      <guid>Huffduffer URL</guid>
      <link>Huffduffer URL</link>
      <enclosure url="audio URL" type="audio/mpeg" length="integer"/>
      <pubDate>date</pubDate>
      <category>string</category>
    </item>
  </channel>
</rss>
Endpoints:
  • http://huffduffer.com/new/rss
  • http://huffduffer.com/username/rss
  • http://huffduffer.com/tags/tag/rss
  • http://huffduffer.com/username/tags/tag/rss
  • http://huffduffer.com/username/collective/rss
  • http://huffduffer.com/username/collective/tags/tag/rss
  • http://huffduffer.com/search/rss?q=query
  • http://huffduffer.com/popular/rss?dtstart=YYYY-MM-DD&dtend=YYYY-MM-DD

Atom

An Atom feed of 20 entries.

Mime-type:
application/xml+atom
Structure:
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>string</title>
  <subtitle type="html">string</subtitle>
  <link rel="alternate" type="text/html" hreflang="en" href="Huffduffer URL"/>
  <link rel="self" type="application/atom+xml" href="Huffduffer Atom URL"/>
  <updated>YYYY-MM-DDThh:mm:ssZ</updated>
  <id>uuid</id>
  <entry>
    <title>string</title>
    <link rel="alternate" type="text/html" href="Huffduffer URL"/>
    <link rel="enclosure" type="audio/mpeg" href="audio URL" length="integer"/>
    <updated>YYYY-MM-DDThh:mm:ssZ</updated>
    <published>YYYY-MM-DDThh:mm:ssZ</published>
    <id>uuid</id>
    <content>string</content>
    <category term="string"/>
    <author>
      <name>username</name>
      <uri>Huffduffer username URL</uri>
    </author>
  </entry>
</feed>
Endpoints:
  • http://huffduffer.com/new/atom
  • http://huffduffer.com/username/atom
  • http://huffduffer.com/tags/tag/atom
  • http://huffduffer.com/username/tags/tag/atom
  • http://huffduffer.com/username/collective/atom
  • http://huffduffer.com/username/collective/tags/tag/atom
  • http://huffduffer.com/search/atom?q=query
  • http://huffduffer.com/popular/atom?dtstart=YYYY-MM-DD&dtend=YYYY-MM-DD

JSON

A JavaScript object containing 20 items.

Mime-type:
application/json
Structure:
{
  "title": "string",
  "link": "Huffduffer URL",
  "items": [
    {
      "title": "string",
      "description": "string",
      "link": "Huffduffer URL",
      "url": "audio URL",
      "date": "YYYY-MM-DDThh:mm:ss",
      "tags": "comma-separated list",
      "author": {
        "fn": "formatted name",
        "nickname": "username",
        "url": "Huffduffer username URL"
      }
    }
  ]
}
Endpoints:
  • http://huffduffer.com/new/json
  • http://huffduffer.com/username/json
  • http://huffduffer.com/tags/tag/json
  • http://huffduffer.com/username/tags/tag/json
  • http://huffduffer.com/username/collective/json
  • http://huffduffer.com/username/collective/tags/tag/json
  • http://huffduffer.com/search/json?q=query
  • http://huffduffer.com/popular/json?dtstart=YYYY-MM-DD&dtend=YYYY-MM-DD

JSONP

To wrap a JSON response in a callback function, specify the function using the argument callback in the query string.

Mime-type:
text/javascript
Structure:
foo({
  "title": "string",
  "link": "Huffduffer URL",
  "items": [
    {
      "title": "string",
      "description": "string",
      "link": "Huffduffer URL",
      "url": "audio URL",
      "date": "YYYY-MM-DDThh:mm:ss",
      "tags": "comma-separated list",
      "author": {
        "fn": "formatted name",
        "nickname": "username",
        "url": "Huffduffer username URL"
      }
    }
  ]
})
Endpoints:
  • http://huffduffer.com/new/json?callback=foo
  • http://huffduffer.com/username/json?callback=foo
  • http://huffduffer.com/tags/tag/json?callback=foo
  • http://huffduffer.com/username/tags/tag/json?callback=foo
  • http://huffduffer.com/username/collective/json?callback=foo
  • http://huffduffer.com/username/collective/tags/tag/json?callback=foo
  • http://huffduffer.com/search/json?q=query&callback=foo
  • http://huffduffer.com/popular?dtstart=YYYY-MM-DD&dtend=YYYY-MM-DD&callback=foo

XSPF

An XML file of 20 tracks.

Mime-type:
application/xml+xspf
Structure:
<?xml version="1.0" encoding="utf-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
  <title>string</title>
  <trackList>
    <track>
      <location>audio URL</location>
      <title>string</title>
      <annotation>string</annotation>
      <info>Huffduffer URL</info>
    </track>
  </trackList>
</playlist>
Endpoints:
  • http://huffduffer.com/new/xspf
  • http://huffduffer.com/username/xspf
  • http://huffduffer.com/tags/tag/xspf
  • http://huffduffer.com/username/tags/tag/xspf
  • http://huffduffer.com/username/collective/xspf
  • http://huffduffer.com/username/collective/tags/tag/xspf
  • http://huffduffer.com/search/xspf?q=query
  • http://huffduffer.com/popular/xspf?dtstart=YYYY-MM-DD&dtend=YYYY-MM-DD

Microformats

If you don't append a file format to the end of a URL, pages are returned as HTML5. These pages are marked up using compound microformats so you can parse the HTML directly.

hAtom, xFolk

An HTML fragment of 10 items.

Mime-type:
text/html
Structure:
<ol class="hfeed">
  <li class="hentry">
    <h3 class="entry-title">
      <a rel="bookmark" href="Huffduffer URL">string</a>
    </h3>
    <div class="entry-content">
      HTML
    </div>
    <div class="xfolkentry">
      <p>
        <a rel="enclosure" class="taggedlink" href="audio URL" type="audio/mpeg" title="string">download</a>
      </p>
      <p class="tagged">
        Tagged with
        <a rel="tag" href="Huffduffer URL">string</a>
      </p>
    </div>
    <p class="author vcard">
      —Huffduffed by
      <a class="fn nickname url" href="Huffduffer username URL">username</a>
      <abbr class="published" title="YYYY-MM-DDThh:mm:ss">string</abbr>
    </p>
  </li>
</ol>
Endpoints:
  • http://huffduffer.com/new
  • http://huffduffer.com/username
  • http://huffduffer.com/tags/tag
  • http://huffduffer.com/username/tags/tag
  • http://huffduffer.com/username/collective
  • http://huffduffer.com/username/collective/tags/tag
  • http://huffduffer.com/search?q=query
  • http://huffduffer.com/popular?dtstart=YYYY-MM-DD&dtend=YYYY-MM-DD

YQL

All the data available through the Huffduffer API is available through Yahoo’s YQL service. You can test it at the following URL:

http://developer.yahoo.com/yql/console/?q=show%20tables&env=store://datatables.org/alltableswithkeys