Podping via Websockets

Following on the heels of our free Podping syndication service over WebSub, we are also making Podpings available to client-side developers for free over standard Websockets.

Simply point your client code to wss://api.livewire.io/ws/podping, it’s as simple as that - no need for callback servers.


Live view of the latest Podpings:


Example browser-side script:

    const ws = new WebSocket("wss://api.livewire.io/ws/podping");
    ws.addEventListener("message", event => {
        const msg = JSON.parse(event.data);
        // see message format below
        if (msg.t === "podping") {
            console.log("podping message", msg);
            for (const op of msg.p) {
                for (const url of op.p.urls) {
                    // process feed url
                }
            }
        }
    });
    ws.addEventListener("close", event => {
        // handle close event
    });
    ws.addEventListener("error", event => {
        // handle error event
    });

Message format:

interface PodpingMessage {
     /** Type. */ 
    readonly t: 'podping';

    /** Version. */ 
    readonly v: 1;

    /** Hive api server polled by the backend to provide the data. */ 
    readonly a: string;

    /** Hive block number. */ 
    readonly n: number;

    /** Hive operation count.
     * 
     * Total number of operations in the block, not just Podpings. */ 
    readonly o: number;

    /** Podping operations. */
    readonly p: Operation[];
}

interface Operation {
    /** Auth used to write the transaction. */ 
    readonly a: string;
    
    /** ISO 8601 timestamp. */
    readonly t: string;

    /** Podping. */
    readonly p: Podping;
}

// Raw Podping payload json format
// i.e. "json" from https://github.com/Podcastindex-org/podping.cloud#what-it-does
interface Podping {
    readonly version: string;
    readonly num_urls: number;
    readonly reason: 'feed_update';
    readonly urls: string[];
}

Modify this page, Discuss this page