Exemplo n.º 1
0
from imouto import Imouto,ImoutoSettings
import sys

usage = "Usage: imouto collect [collector]"

args = sys.argv
if len(args) < 2:
        print usage
else:

	cfg = ImoutoSettings()
	im = Imouto(cfg.getSetting('host'), cfg.getSetting('database'), cfg.getSetting('user'), cfg.getSetting('password'))

	rows = im.collectorImport(args[1])
	print str(rows) + " entries added or updated."

Exemplo n.º 2
0
from imouto import ImoutoSettings
import urllib2,sys,_mysql

cfg = ImoutoSettings()
server = cfg.getSetting('host')
database = cfg.getSetting('database')
username = cfg.getSetting('user')
password = cfg.getSetting('password')


query = "select * from Events order by StartTime ASC"
dl = _mysql.connect(host=server,user=username,passwd=password,db=database)
dl.query(query)
r = dl.store_result()
c = r.num_rows()
for i in range(0, c):
	id = str(r.fetch_row(1,1)[0]['ID'])
	url = "http://localhost/imouto/event/" + id + "/people.json"
	print url
	urllib2.urlopen(url)
	url = "http://localhost/imouto/event/" + id + "/places.json"
	print url
	urllib2.urlopen(url)