Example #1
0
from Web import Web

url = 'http://www.qqride.com/category/scheduled/page/1/'

cnrun = Web(url, 'site-main', 'entry-title', 'single-content')

#print(cnrun.soup)

cnrun.getlist()


def p(L):
    return 'http://www.chinarun.com' + L


#cnrun.map(p)


def getGen():
    return cnrun.process()


if __name__ == "__main__":
    #this is for test only

    for i in getGen():
        print(i)
Example #2
0
 def __init__(self, browser):
     self._web = Web(browser)
Example #3
0
from Web import Web

#this file will thow some errors, remember to catch it

url='http://ps.zestbike.com/match/preview'

cnrun=Web(url,'pagecontent','commonlist yahei','commonarticle yahei')


#print(cnrun.soup)

cnrun.getlist()

def p(L):
    return 'http://ps.zestbike.com/'+L

print(cnrun.list)


cnrun.map(p)

def getGen():
    return cnrun.process()

if __name__=="__main__":
    #this is for test only
    number=0
    for i in getGen():
    	print(i)
    	number+=1
    	print(number)
Example #4
0
from Web import Web
url = 'http://www.wildto.com/event/'

cnrun = Web(url, 'cmptList clearfix', 'pic', 'leftBox')

#print(cnrun.soup)

cnrun.getlist()


def p(L):
    return 'http://www.wildto.com' + L


cnrun.map(p)


def getGen():
    return cnrun.process()


if __name__ == "__main__":
    #this is for test only

    for i in getGen():
        print(i)
Example #5
0
from Web import Web

cnrun = Web(
    'http://www.chinarun.com/html/event_k_%20%E8%87%AA%E8%A1%8C%E8%BD%A6%E8%B5%9B_0_.html#cnt',
    'ulHdList', 'n', 'divCnt divHA')

cnrun.getlist()


def p(L):
    return 'http://www.chinarun.com' + L


cnrun.map(p)


def getGen():
    return cnrun.process()


if __name__ == "__main__":
    #this is for test only
    for i in getGen():
        print(i[0])
Example #6
0
import ujson

import WifiConnect
from LedController import LedController
from Scheduler import Scheduler
from Web import Web

hostname = open("config.hostname.txt").read()
print("hostname = {}".format(hostname))
config_file = "config.{0}.json".format(hostname)
config = ujson.loads(open(config_file).read())
print("config = {}".format(config))

ssid = config.get("ssid")
password = open("wifi-password.txt").read()
WifiConnect.connect(ssid, password, hostname)

led_data_pin = int(config.get("led_data_pin"))
led_count = int(config.get("led_count"))
led_bpp = int(config.get("led_bpp"))
ledController = LedController(led_data_pin, led_count, led_bpp)

ledController.all_off()
ledController.pulse_status_led(0, 12, 32, 0)

scheduler = Scheduler(ledController)

web = Web(ledController, scheduler)

scheduler.run()
def main():
    web = Web()
    web.run_ftp_server()
Example #8
0
from Web import Web
import re

url = 'http://zuicool.com/news/archives/category/user-submitted/%E8%87%AA%E8%A1%8C%E8%BD%A6'

cnrun = Web(url, 'container', 'zuicool-index-post clearfix', 'entry-content')

cnrun.getlist()


def p(L):
    return 'http://zuicool.com' + L


cnrun.map(p)


def getGen():
    return w(cnrun.process())


def w(process):
    for i in process:
        title = re.findall('报名 | (.*) - 最酷ZUICOOL - 马拉松赛事第一站_最COOL', i[0])
        if len(title) is 1:
            title = title[0]
        else:
            title = title[1]
        yield (title, i[1])

Example #9
0
#!/usr/bin/python
# coding=utf-8
from Utils import Utils

__author__ = "Aleksandr Shyshatsky"

from Battle import Battle
from Flash import Flash
from Callbacks import Callbacks
from Events import Events
from Web import Web

callbacks = Callbacks()
flash = Flash()
battle = Battle()
events = Events()
web = Web()
utils = Utils

__all__ = ['flash', 'battle', 'callbacks', 'events', 'web', 'utils']