Client Guide
You can make your own Walltaker client! A user should be able to supply any link ID, that you can then use to open a websocket to that instance. The server sends the current wallpaper when the
subscription opens, then sends a new wallpaper whenever the link changes.
Older polling clients still work for now.
HTTP polling is now deprecated.
Connect To A Link
Open a WebSocket connection to Walltaker at wss://www.walltaker.com/cable, then subscribe to
LinkChannel. Supply the user's link ID as link_id (or id). Both numeric and custom link IDs are accepted.
You can also pass a client identifier during subscription, however this will only appear if a site admin adds your client to the list.
// npm install @rails/actioncable; bundle this module for your browser client.
import { createConsumer } from "@rails/actioncable";
async function setWallpaper(url) {
// Replace this stub with your download and platform-specific wallpaper code.
// Reject/throw if either step fails; resolve only after applying the wallpaper.
console.log("Set wallpaper to", url);
}
const consumer = createConsumer("wss://www.walltaker.com/cable");
let currentPostUrl = null;
let latestLink = null;
let applying = false;
let watchedUser = null;
async function applyLatest() {
if (applying) return;
applying = true;
try {
while (latestLink) {
const link = latestLink;
if (!link.post_url) { currentPostUrl = null; break; }
if (link.post_url === currentPostUrl) break;
const urls = [...new Set([link.post_url, link.post_url_backup].filter(Boolean))];
let applied = false;
for (const url of urls) {
try {
await setWallpaper(url);
currentPostUrl = link.post_url; // Keep the primary URL even after a backup download.
applied = true;
break;
} catch (error) {
console.warn("Wallpaper download/application failed", error);
}
}
if (!applied && latestLink === link) {
await new Promise(resolve => setTimeout(resolve, 5000));
}
}
} finally {
applying = false;
}
}
// Action Cable handles protocol pings, reconnects and resubscription.
const subscription = consumer.subscriptions.create(
{ channel: "LinkChannel", link_id: 1, client: "My Walltaker Client/1.0.0" },
{
connected() {
if (watchedUser) this.perform("watch_user", watchedUser);
},
rejected() { console.error("Link subscription rejected"); },
received(link) {
if (!link || typeof link !== "object") return;
if (link.type === "user") { console.log("User status", link); return; }
if (!link.success) { console.error(link.why || "Link unavailable"); return; }
if (!("post_url" in link)) return;
latestLink = link;
void applyLatest(); // Serialize wallpaper work without blocking incoming updates.
}
}
);
function watchUser(username, apiKey) {
watchedUser = { username, api_key: apiKey };
subscription.perform("watch_user", watchedUser);
}
# python -m pip install "websockets>=14"
import asyncio
import json
from contextlib import suppress
from websockets.asyncio.client import connect
from websockets.exceptions import ConnectionClosed
def set_wallpaper(url):
# Replace this stub with your download and platform-specific wallpaper code.
# Raise if either step fails; return only after applying the wallpaper.
print(f"Set wallpaper to {url}")
async def main():
current_post_url = None
latest_link = None
changed = asyncio.Event()
identifier = json.dumps({
"channel": "LinkChannel", "link_id": 1,
"client": "My Walltaker Client/1.0.0",
})
async def apply_latest():
nonlocal current_post_url
while True:
await changed.wait()
changed.clear()
while latest_link is not None:
link = latest_link
post_url = link.get("post_url")
if not post_url:
current_post_url = None
break
if post_url == current_post_url:
break
urls = dict.fromkeys(filter(None, [post_url, link.get("post_url_backup")]))
applied = False
for url in urls:
try:
# Keep downloads and platform calls off the socket's event loop.
await asyncio.to_thread(set_wallpaper, url)
current_post_url = post_url
applied = True
break
except Exception as error:
print(f"Wallpaper download/application failed: {error}")
if not applied and latest_link is link:
try:
await asyncio.wait_for(changed.wait(), timeout=5)
except asyncio.TimeoutError:
pass
changed.clear()
worker = asyncio.create_task(apply_latest())
try:
# The library answers native WebSocket pings and backs off on connection errors.
async for socket in connect("wss://www.walltaker.com/cable",
subprotocols=["actioncable-v1-json"],
max_size=16 * 1024 * 1024):
try:
async for raw_message in socket:
try:
envelope = json.loads(raw_message)
except (json.JSONDecodeError, UnicodeDecodeError):
continue
if not isinstance(envelope, dict):
continue
kind = envelope.get("type")
if kind == "welcome":
await socket.send(json.dumps({"command": "subscribe", "identifier": identifier}))
continue
if kind == "disconnect":
if envelope.get("reconnect") is False:
print("Server stopped this connection:", envelope.get("reason"))
return
break
if kind == "reject_subscription":
print("Link subscription rejected")
return
if kind is not None or envelope.get("identifier") != identifier:
continue # Includes JSON pings and subscription confirmations.
link = envelope.get("message")
if not isinstance(link, dict) or link.get("type") == "user":
continue
if link.get("success") is False:
print(link.get("why", "Link unavailable"))
return
if link.get("success") is True and "post_url" in link:
latest_link = link
changed.set()
except ConnectionClosed as error:
print(f"Connection lost: {error}")
finally:
await socket.close()
await asyncio.sleep(1) # Also bound retries after clean server disconnects.
finally:
worker.cancel()
with suppress(asyncio.CancelledError):
await worker
if __name__ == "__main__":
asyncio.run(main())
// C++17; link IXWebSocket with TLS support, nlohmann_json and threads.
#include <chrono>
#include <condition_variable>
#include <exception>
#include <iostream>
#include <mutex>
#include <string>
#include <thread>
#include <vector>
#include <nlohmann/json.hpp>
#include <ixwebsocket/IXNetSystem.h>
#include <ixwebsocket/IXWebSocket.h>
using json = nlohmann::json;
void set_wallpaper(const std::string& url) {
// Replace this stub with your download and platform-specific wallpaper code.
// Throw if either step fails; return only after applying the wallpaper.
std::cout << "Set wallpaper to " << url << std::endl;
}
int main() {
ix::initNetSystem();
ix::WebSocket socket;
socket.setUrl("wss://www.walltaker.com/cable");
socket.addSubProtocol("actioncable-v1-json");
socket.enablePong();
socket.enableAutomaticReconnection();
socket.setMinWaitBetweenReconnectionRetries(1000);
socket.setMaxWaitBetweenReconnectionRetries(30000);
const auto identifier = json{
{"channel", "LinkChannel"}, {"link_id", 1},
{"client", "My Walltaker Client/1.0.0"}
}.dump();
std::mutex mutex;
std::condition_variable changed;
json latest_link;
bool pending = false, stopping = false;
std::thread worker([&] {
std::string current_post_url;
while (true) {
json link;
{
std::unique_lock<std::mutex> lock(mutex);
changed.wait(lock, [&] { return stopping || pending; });
if (stopping) return;
link = latest_link;
pending = false;
}
const std::string post_url = link["post_url"].is_string()
? link["post_url"].get<std::string>() : "";
if (post_url.empty()) { current_post_url.clear(); continue; }
if (post_url == current_post_url) continue;
std::vector<std::string> urls{post_url};
if (link.contains("post_url_backup") && link["post_url_backup"].is_string()) {
const auto backup = link["post_url_backup"].get<std::string>();
if (!backup.empty() && backup != post_url) urls.push_back(backup);
}
bool applied = false;
for (const auto& url : urls) {
try {
set_wallpaper(url); // Runs off the socket thread so pongs aren't delayed.
current_post_url = post_url;
applied = true;
break;
} catch (const std::exception& error) {
std::cerr << "Wallpaper download/application failed: " << error.what() << std::endl;
}
}
if (!applied) {
std::unique_lock<std::mutex> lock(mutex);
changed.wait_for(lock, std::chrono::seconds(5), [&] { return stopping || pending; });
if (!stopping && !pending) { latest_link = link; pending = true; }
}
}
});
socket.setOnMessageCallback([&](const ix::WebSocketMessagePtr& msg) {
if (msg->type != ix::WebSocketMessageType::Message) return;
const auto envelope = json::parse(msg->str, nullptr, false);
if (!envelope.is_object()) return;
const auto type = envelope.find("type");
if (type != envelope.end()) {
if (*type == "welcome") {
socket.send(json{{"command", "subscribe"}, {"identifier", identifier}}.dump());
} else if (*type == "disconnect" || *type == "reject_subscription") {
if (*type == "reject_subscription" ||
(envelope.contains("reconnect") && envelope["reconnect"] == false)) {
socket.disableAutomaticReconnection();
}
socket.close();
}
return; // Includes JSON pings and subscription confirmations.
}
if (!envelope.contains("identifier") || envelope["identifier"] != identifier) return;
const auto message = envelope.find("message");
if (message == envelope.end() || !message->is_object()) return;
const auto& link = *message;
if (link.contains("type")) return; // User-status messages aren't wallpaper updates.
if (!link.contains("success") || link["success"] != true) {
std::cerr << "Link unavailable: " << link.dump() << std::endl;
return;
}
if (!link.contains("post_url") || !(link["post_url"].is_null() || link["post_url"].is_string())) return;
{
std::lock_guard<std::mutex> lock(mutex);
latest_link = link;
pending = true;
}
changed.notify_one();
});
socket.start();
std::cin.get();
socket.stop();
{
std::lock_guard<std::mutex> lock(mutex);
stopping = true;
}
changed.notify_one();
worker.join();
ix::uninitNetSystem();
}
The JavaScript example uses the Action Cable client. Python and C++ connect directly and read the payload from the
Action Cable envelope's message field; ignore control frames such as welcomes, pings, and subscription confirmations.
The setWallpaper/set_wallpaper function is where your client downloads and applies the wallpaper.
Native clients may also identify themselves with WebSocket handshake headers such as User-Agent,
joihow, User_Agent, or Wallpaper-Engine-Client. Browser WebSocket clients
usually cannot set custom handshake headers, so use subscription params or announce_client.
subscription.perform("announce_client", {
client: "My Walltaker Client/1.0.0"
});
Link Updates
The server sends this payload immediately after subscribing and every time client-visible link state changes. Treat
post_url as the current wallpaper URL. If that request is rejected by the e621 CDN, clients can retry
with post_url_backup, a Walltaker-hosted URL that supplies the CDN's required request headers. The backup
is null when the primary URL is not a supported e621 media URL. The token below is a placeholder;
use the complete backup URL received from the server. Users can enable videos and GIFs on some links, so clients
should handle file types they cannot display. post_url can also be null if no wallpaper is set.
{
"success": true,
"id": 1,
"expires": "2026-12-31T00:00:00.000Z",
"username": "gray",
"terms": "I'm trying out something new, break this please! :)",
"blacklist": "feet blood",
"post_url": "https://static1.e621.net/data/5d/87/5d87428c4839b0dc7d585b87a25af61a.png",
"post_url_backup": "https://www.walltaker.com/e621-media?token=SIGNED_TOKEN",
"post_thumbnail_url": "https://static1.e621.net/data/preview/5d/87/5d87428c4839b0dc7d585b87a25af61a.jpg",
"post_description": "",
"created_at": "2022-03-08T01:01:50.142Z",
"updated_at": "2026-10-18T12:00:00.000Z",
"set_by": "apple",
"response_type": "horny",
"response_text": "mmph nice",
"online": true
}
Link updates always include the fields above. set_by is a username or null;
response_type and response_text may be null before a reaction is sent.
post_description is the full description in WebSocket updates. Presence and reaction changes also trigger
updates, so download the wallpaper only when post_url changes.
If the link does not exist, the channel sends an error payload and does not stream link updates.
{
"success": false,
"why": "Link 0 does not exist."
}
POST https://www.walltaker.com/api/links/[id]/response.json
Set a response for a given link. There are 4 kinds of responses.
đ Requires the link owner's API key. Use the numeric id from the link payload in this endpoint.
type |
Shown In UI as | Effect |
|---|---|---|
"horny" |
Love it | User who set wallpaper gets notification, response text displayed on link in webapp |
"disgust" |
Hate it | User who set wallpaper gets notification, wallpaper rolled back to previous image |
"came" |
Came | User who set wallpaper gets notification, response text displayed on link in webapp |
"ok" |
Thanks | User who set wallpaper gets notification, response text displayed on link in webapp |
â ī¸ A disgust response rolls the wallpaper back to the previous image and sends the changed state over the WebSocket.
If no previous image exists, post_url and post_thumbnail_url become null.
POST https://www.walltaker.com/api/links/1/response.json HTTP/1.1
Content-Type: application/json
{
"api_key": "23unFe3i",
"type": "horny",
"text": "mmph nice"
}
A successful request returns HTTP 200 and the link JSON below. Unlike a WebSocket link update, this response
has no success field. set_by is omitted when no setter is recorded, and
post_description is omitted when blank or truncated to 100 characters when present.
An invalid API key returns 403, an invalid reaction type returns 400, and a missing link returns
404; these errors contain a message field.
{
"id": 1,
"expires": "2026-12-31T00:00:00.000Z",
"username": "gray",
"terms": "I'm trying out something new, break this please! :)",
"blacklist": "feet blood",
"post_url": "https://static1.e621.net/data/5d/87/5d87428c4839b0dc7d585b87a25af61a.png",
"post_url_backup": "https://www.walltaker.com/e621-media?token=SIGNED_TOKEN",
"post_thumbnail_url": "https://static1.e621.net/data/preview/5d/87/5d87428c4839b0dc7d585b87a25af61a.jpg",
"created_at": "2022-03-08T01:01:50.142Z",
"updated_at": "2026-10-18T12:00:00.000Z",
"set_by": "apple",
"response_type": "horny",
"response_text": "mmph nice",
"online": true
}
Watch User Status
Use this on the existing link websocket to get details about a user, such as if they're online, a friend, or the
currently authenticated user for a given session. This replaces
GET https://www.walltaker.com/api/users/[username].json?api_key=xxxxxxxx.
đ/đ API key required for some, but not all data.
âšī¸ The links array contains public, unexpired (or never-expiring) links. Each entry excludes
success and set_by; post_description is omitted when blank and truncated to 100 characters when present.
friend and self are included only when an API key or browser session authenticates the viewer.
The legacy field master contains the owner's username, or false if no owner is set.
watchUser("apple", "23unFe3i");
Call watch_user again with a new username when the wallpaper is set by someone else.
{
"type": "user",
"success": true,
"watching": true,
"user": {
"username": "apple",
"id": 24,
"set_count": 540,
"is_reporter": false,
"is_cutie": false,
"is_supporter": false,
"online": true,
"authenticated": true,
"links": [
{
"id": 1,
"expires": "2026-12-31T00:00:00.000Z",
"username": "apple",
"terms": "I'm trying out something new, break this please! :)",
"blacklist": "feet blood",
"post_url": "https://static1.e621.net/data/5d/87/5d87428c4839b0dc7d585b87a25af61a.png",
"post_url_backup": "https://www.walltaker.com/e621-media?token=SIGNED_TOKEN",
"post_thumbnail_url": "https://static1.e621.net/data/preview/5d/87/5d87428c4839b0dc7d585b87a25af61a.jpg",
"created_at": "2022-03-08T01:01:50.142Z",
"updated_at": "2026-10-18T12:00:00.000Z",
"response_type": "horny",
"response_text": "mmph nice",
"online": true
}
],
"flair": "",
"master": false,
"pets": [],
"friend": true,
"self": false
}
}
Migrating Older Clients
Replace polling GET /api/links/[id].json with one long-lived LinkChannel subscription.
The WebSocket message payload intentionally matches the link JSON shape, so most wallpaper update code can keep using
post_url, post_url_backup, post_thumbnail_url, set_by, and
updated_at.
| Old polling behavior | WebSocket replacement |
|---|---|
Poll /api/links/[id].json every 10 seconds |
Subscribe once to LinkChannel |
Compare cached post_url or updated_at |
Read each successful link payload; download media only when post_url changes |
| Send client identity through HTTP headers | Send client in subscription params or announce_client |
| Polling keeps the link online | An open WebSocket keeps the link online; disconnects are removed automatically |
Re-poll after disgust responses |
Wait for the next WebSocket payload after sending the response |
