Exemple #1
0
def init():
    global state
    global initdone
    state = PlugState()
    state.define('urls', {})
    initdone = True
    return 1
Exemple #2
0
def init():
    global state
    global initdone
    state = PlugState()
    state.define('urls', {})
    initdone = True
    return 1
Exemple #3
0
import os
import logging
import uuid
import time
import StringIO
import gzip
import urllib

## defines

cfg = PersistConfig()
cfg.define("enable", 0)
cfg.define("sleep", 5)

state = PlugState()
state.define("ids", {})
state.define("seen", [])
state.define("names", {})
state.define("watch", [])

teller = 0
dostop = False

## plugin init


def init_threaded():
    try:
        if cfg.enable:
            sync()
Exemple #4
0
from jsb.lib.commands import cmnds
from jsb.lib.examples import examples
from jsb.lib.callbacks import first_callbacks
from jsb.lib.morphs import outputmorphs
from jsb.lib.persiststate import PlugState
from jsb.utils.lazydict import LazyDict

## basic imports

import re
import logging

## defines

state = PlugState()
state.define("colormapping", {})

## the morph

def docolormorph(txt, event):
    if not txt: return txt
    if event and not event.bottype == "irc": return txt
    splitted = txt.split()
    for s in splitted:
        for t, color in state.data.colormapping.iteritems():
            try: c = int(color)
            except: logging.warn("color - %s is not a digit" % color) ; continue
            if t in s: txt = txt.replace(s, "\003%s%s\003" % (c, s))
    return txt
Exemple #5
0
from jsb.lib.commands import cmnds
from jsb.lib.examples import examples
from jsb.lib.callbacks import first_callbacks
from jsb.lib.morphs import outputmorphs
from jsb.lib.persiststate import PlugState
from jsb.utils.lazydict import LazyDict

## basic imports

import re
import logging

## defines

state = PlugState()
state.define("colormapping", {})

## the morph

def docolormorph(txt, event):
    """ add the color to the txt. """
    if not txt: return txt
    if event and not event.bottype == "irc": return txt
    splitted = txt.split()
    for s in splitted:
        for t, color in state.data.colormapping.iteritems():
            try: c = int(color)
            except: logging.warn("color - %s is not a digit" % color) ; continue
            if c < 0: d = "00"
            elif c < 9: d = "0%s" % c
Exemple #6
0
from jsb.imports import getjson

json = getjson()

## basic imports

import os
import logging
import uuid

## defines

cfg = PersistConfig()
cfg.define("enable", 0)

state = PlugState()
state.define("ids", {})
state.define("seen", {})

teller = 0

## getplus function

def getplus(target):
    credentials = _import_byfile("credentials", getdatadir() + os.sep + "config" + os.sep + "credentials.py")
    url = "https://www.googleapis.com/plus/v1/people/%s/activities/public?alt=json&pp=1&key=%s" % (target, credentials.googleclient_apikey)
    result = geturl2(url)
    data = json.loads(result)
    res = []
    for item in data['items']:
        i = LazyDict(item)
Exemple #7
0
import os
import logging
import uuid
import time
import StringIO
import gzip
import urllib

## defines

cfg = PersistConfig()
cfg.define("enable", 0)
cfg.define("sleep", 5)

state = PlugState()
state.define("ids", {})
state.define("seen", [])
state.define("names", {})
state.define("watch", [])

teller = 0
dostop = False

## plugin init

def init_threaded():
    try:
        if cfg.enable: sync() ; scan()
    except URLNotEnabled: logging.error("URL fetching is not enabled")
Exemple #8
0
def init():
    global initdone
    state = PlugState()
    state.define('council', {})
    initdone = True
    return 1
Exemple #9
0
from jsb.imports import getjson

json = getjson()

## basic imports

import os
import logging
import uuid

## defines

cfg = PersistConfig()
cfg.define("enable", 0)

state = PlugState()
state.define("ids", {})
state.define("seen", {})

teller = 0

## getplus function


def getplus(target):
    credentials = _import_byfile(
        "credentials",
        getdatadir() + os.sep + "config" + os.sep + "credentials.py")
    url = "https://www.googleapis.com/plus/v1/people/%s/activities/public?alt=json&pp=1&key=%s" % (
        target, credentials.googleclient_apikey)
    result = geturl2(url)