Skip to content

Instantly share code, notes, and snippets.

View gdude2002's full-sized avatar

Gareth Coles gdude2002

View GitHub Profile
<section id="content" class="body center">
<?php
$socketdie = "No information avaliable";
function runcmd($cmd, $data = NULL ){
global $socket;
$jsondata = json_encode(array ('password'=>'bingy','command'=>$cmd, $data[0]=>$data[1]))."\r\n";
socket_send($socket, $jsondata, strlen($jsondata),0);
if (($bytes = socket_recv($socket, $buf, 16384, NULL)) == false) die($socketdie);
//echo "raw data = ".$buf."<br>";
return json_decode($buf);
import sys
import os
import datetime
import struct
import urllib
import urllib2
import re
import socket
import cookielib
import threading
import sys
import os
import datetime
import struct
import urllib
import urllib2
import re
import socket
import cookielib
import threading
import sys
import os
import datetime
import struct
import urllib
import urllib2
import re
import socket
import cookielib
import threading
import struct
from constants import *
class Format(object):
def __init__(self, format):
self.format = format
def __len__(self):
import feedparser
import irclib
import threading
import time
import datetime
import os
class IRCBot(irclib.SimpleIRCClient):
def __init__(self, password, channels, SERVER, PORT, NICKNAME):
irclib.SimpleIRCClient.__init__(self)
Traceback (most recent call last):
File "/usr/local/lib/python2.6/site-packages/twisted/python/log.py", line 84, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/local/lib/python2.6/site-packages/twisted/python/log.py", line 69, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/local/lib/python2.6/site-packages/twisted/python/context.py", line 59, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python2.6/site-packages/twisted/python/context.py", line 37, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
2014-12-02.log-[22:08:12] <g> but every modification you make has to be done immutably
2014-12-02.log-[22:08:25] <Riking> yeeeeeeah
2014-12-02.log-[22:08:31] <g> don't like it
2014-12-02.log-[22:08:32] <g> :P
2014-12-02.log-[22:08:37] <simon816> seems very memory inefficient
2014-12-02.log-[22:08:42] <g> yeah
2014-12-02.log-[22:08:50] <Riking> Going to need some other kind of value store
2014-12-02.log-[22:09:00] <g> I wrote a little wrapper for snakeyaml
2014-12-02.log-[22:09:00] <g> lol
2014-12-02.log-[22:09:26] <sk89q> gson is on class path I think
@gdude2002
gdude2002 / ello.md
Last active August 29, 2015 14:07 — forked from conatus/ello.md

Ello API

This is a basic exploration of the Ello API. Completely unofficial, your mileage my vary, don't smash their servers as they are likely very busy.

Methods return HTML for their representation where appropriate which is a nice little pattern. Everything returns application/json.

Like this:

{
 "id": ,