24 lines
534 B
Python
24 lines
534 B
Python
"""
|
|
main entry point for the Craigslist scraper
|
|
starts webserver
|
|
"""
|
|
|
|
import web.app as app
|
|
import threading
|
|
from web.craigslist import start_scheduler
|
|
|
|
|
|
def start_background_scheduler():
|
|
"""Start the scheduler in a background thread."""
|
|
scheduler_thread = threading.Thread(target=start_scheduler, daemon=True)
|
|
scheduler_thread.start()
|
|
print("Background scheduler started")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
# Start scheduler in background thread
|
|
start_background_scheduler()
|
|
|
|
# start web server
|
|
app.main()
|