def post(self): args = configPostParser.parse_args() key = args.get('key') config = json.loads(args.get('config')) return MI.postConfig(key, config)
def post(self): args = dataPostParser.parse_args() key = args.get('key') nodes = json.loads(args.get('nodes')) connections = json.loads(args.get('connections')) return MI.postData(key, nodes, connections)
import codecs import urlparse import re from time import strftime import lxml.html from slugify import slugify from db import MongoInstance from client import Client from char_replacer import CharReplacer # connect to db db_name = "istanbus_" + strftime("%Y-%m-%d") # i.e istanbus_2012-02-09 mongo_instance = MongoInstance(db_name) # replacer replacer = CharReplacer() bus_stops_url = "/hatdetay.php" bus_time_url = "/hatsaat.php" stop_keyword = 'hatsaat.php?' # prepare headers for .xml files headers = {"Host": "harita.iett.gov.tr", "Referer": "http://harita.iett.gov.tr/XML/"} client = Client("harita.iett.gov.tr:80") client_mobile = Client("mobil.iett.gov.tr:80") mongo_instance.ensure_index_bus('id') def parse_href(href): # href is like JavaScript:hattahmin('Ş0026','ŞİŞHANE 6')
def get(self): args = dataGetParser.parse_args() key = args.get('key') return MI.getData(key)
def get(self): args = configGetParser.parse_args() key = args.get('key') return MI.getConfig(key)
import codecs import urlparse import re from time import strftime import lxml.html from slugify import slugify from db import MongoInstance from client import Client from char_replacer import CharReplacer # connect to db db_name = "istanbus_" + strftime("%Y-%m-%d") # i.e istanbus_2012-02-09 mongo_instance = MongoInstance(db_name) # replacer replacer = CharReplacer() bus_stops_url = "/hatdetay.php" bus_time_url = "/hatsaat.php" stop_keyword = 'hatsaat.php?' # prepare headers for .xml files headers = {"Host": "harita.iett.gov.tr", "Referer": "http://harita.iett.gov.tr/XML/"} client = Client("harita.iett.gov.tr:80") client_mobile = Client("mobil.iett.gov.tr:80") mongo_instance.ensure_index_bus('id') mongo_instance.ensure_index_bus('stops.go.id', False) mongo_instance.ensure_index_bus('stops.turn.id', False)