Official Auto-Meme Enterprise API

Where the memes at?

All you have to do is GET one of these URLs:

text may be abbreviated to txt.

Format

text and html both return a list of memes, separated by newline characters (\n).

Memes may be returned as a JSON list object by appending .json to the URL.

There are some differences between text and html output:

text html
Emphasis _DERP_ <em>DERP</em> DERP
Smart quotes IT'S IT&rsquo;S IT’S
Ellipsis ... &#8230;
Em dash -- &mdash;
Snowman SNOWMAN &#9731;

As illustrated here, html uses some HTML entities, and <em> for emphasis, while text will try to use the ASCII equivalents. Regardless, all output is UTF-8 encoded.

The underscore character is used exclusively for emphasis in text output, and can be safely removed.

Parameters

Ten memes are returned by default. This can be changed by appending ?lines=n to the URL, where n is a number in the range 1–80. For example: http://api.automeme.net/text?lines=25

Further info

Significant changes to the API will be posted to the Auto-Meme blog.

Don't hammer the server plz thx. <3

Diving in

From a shell

curl api.automeme.net/text?lines=1
or
wget -q -O - api.automeme.net/text?lines=1

Javascript with jQuery

var url = 'http://api.automeme.net/text.json',
    memes = [];
$.getJSON(url, function(result) {
    memes = result;
    console.log(result[0]);
});

Python

import urllib
url = 'http://api.automeme.net/text'
memes = urllib.urlopen(url).read().rstrip().split('\n')
print memes[0]

Ruby

require 'open-uri'
url = 'http://api.automeme.net/text'
memes = open(url).read.split("\n")
puts memes.first

Perl

use LWP::Simple;
getprint 'http://api.automeme.net/text?lines=1';

Legacy API

Old API commands are still supported:

Current API Old API
/text /moar.txt
/html /moar.html
/text.json /moar.txt.json
/html.json /moar.html.json

The domain names automeme.net and meme.boxofjunk.ws can still be used, but only the old commands will work with these.

Credits

Ruby example by jamiew. Perl example by perigrin.


« Return