Skip to content

JSON output + WordPress? #28

@k0nsl

Description

@k0nsl

It would be a cool thing to output JSON and have it displayed in a WordPress widget, or as a notice somewhere on the WordPress blog.

I'm thinking something like this:

<?php

error_reporting( E_ALL );

$url = 'http://127.0.0.1/www/json.php?type=lastseen&user=k0nsl';

$cURL = curl_init();

curl_setopt($cURL, CURLOPT_URL, $url);
curl_setopt($cURL, CURLOPT_HTTPGET, true);

$result = curl_exec($cURL);

curl_close($cURL);

//print_r($result);

?>

Which would yield something like this:

[{"time":"2013-12-17 05:10:21"}]

The idea I had was that with something like this one could have a widget where we output the last time a user was seen, or what was said the last time, or whatever.

I got to look into it more. Any further ideas on this is welcome :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions