Ejemplo n.º 1
0
# multithreading.py
# Lowes
# Created by Noah Christiano on 7/21/2014.
# [email protected]

from multiprocessing import Process, Queue, Pool
from lowes_automator import LowesAutomator
from database_builder import DatabaseBuilder
import sys
sys.path.append('~/Lowes/locations')
from collector import LocationsCollector

collector = LowesAutomator()
database = DatabaseBuilder()
products = [] #list of pickled lists of items from each store

#get list of store numbers
def get_stores():
	stores = []
	collector = LocationsCollector()
	locations  = collector.get_locations()
	for l in locations:
		if l.country != 'Canada':
			stores.append(l)
	return stores

def worker(store):
	return collector.get_products(store)

stores = get_stores()
if __name__ == '__main__':
Ejemplo n.º 2
0
def populate_db(html_file):
    semester_courses = NovaCourseScraper()
    semester_courses.scrape_html(html_file)
    courses = semester_courses.courses
    builder = DatabaseBuilder(courses)
    builder.build()
Ejemplo n.º 3
0
from discord.ext import commands
import discord
from database_builder import DatabaseBuilder
from discord_helper import DiscordHelper
from news_builder import NewsBuilder
import time
import os
import asyncio
from dotenv import load_dotenv
load_dotenv(override=True)

database = DatabaseBuilder().get_db()
discord_helper = DiscordHelper()
client = discord.Client()
factory = NewsBuilder().get_news_helper()


def get_channel():
    channel_id = int(os.getenv("CHANNEL_ID"))
    return client.get_channel(channel_id)


async def post_news_info():
    try:
        await client.wait_until_ready()
        while (True):
            list_of_searched_stocks = database.get_stocks()
            for stock in list_of_searched_stocks:
                # Call stock news and return list of stock info
                stock_info_list = factory.fetch_news(stock)
                # If there is no news, go to next stock
Ejemplo n.º 4
0
from scraper import NovaCourseScraper
from database_builder import DatabaseBuilder


def populate_db(html_file):
    semester_courses = NovaCourseScraper()
    semester_courses.scrape_html(html_file)
    courses = semester_courses.courses
    builder = DatabaseBuilder(courses)
    builder.build()


if __name__ == "__main__":
    fall16 = NovaCourseScraper()
    fall16.scrape_html("output2.html")
    courses = fall16.courses
    builder = DatabaseBuilder(courses)
    builder.build()
Ejemplo n.º 5
0
# multithreading.py
# Lowes
# Created by Noah Christiano on 7/21/2014.
# [email protected]

from multiprocessing import Process, Queue, Pool
from lowes_automator import LowesAutomator
from database_builder import DatabaseBuilder
import sys
sys.path.append('~/Lowes/locations')
from collector import LocationsCollector

collector = LowesAutomator()
database = DatabaseBuilder()
products = []  #list of pickled lists of items from each store


#get list of store numbers
def get_stores():
    stores = []
    collector = LocationsCollector()
    locations = collector.get_locations()
    for l in locations:
        if l.country != 'Canada':
            stores.append(l)
    return stores


def worker(store):
    return collector.get_products(store)