Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON output + WordPress? #28

Open
k0nsl opened this issue Dec 17, 2013 · 3 comments
Open

JSON output + WordPress? #28

k0nsl opened this issue Dec 17, 2013 · 3 comments

Comments

@k0nsl
Copy link

k0nsl commented Dec 17, 2013

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 :)

@cube-drone
Copy link
Owner

That looks like it should work about as it is. >_> You might want something to parse the incoming JSON and render it into a widget, but...

@k0nsl
Copy link
Author

k0nsl commented Dec 23, 2013

Yeah, getting it rendered in a widget would be the ultimate and desired result 👍

@k0nsl
Copy link
Author

k0nsl commented Dec 24, 2013

I have it working now, more or less. Now I have to figure out how to pull out data on last sent message and such.

Example:
https://k0nsl.org/blog/irc-activity-test/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants