cube-drone / pierc

A python bot that logs IRC channels, and a PHP/JS interface for browsing said logs.
http://classam.github.com/pierc/
Other
52 stars 24 forks source link

JSON output + WordPress? #28

Open k0nsl opened 10 years ago

k0nsl commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

Yeah, getting it rendered in a widget would be the ultimate and desired result :+1:

k0nsl commented 10 years ago

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/